#include #include #include #include #include #include #include //#include #define LL long long using namespace std; const int N = 2000010, mod = 1e9 + 7; LL f[N], f2[N], inv[N]; inline LL C (int n, int m) { if (m < 0 || n < m) return 0; return f[n] * f2[m] % mod * f2[n - m] % mod; } int main () { // freopen ("in.txt", "r", stdin); f[0] = f[1] = f2[0] = f2[1] = inv[0] = inv[1] = 1; for (int i = 2; i < N; i++) { f[i] = f[i - 1] * i % mod; inv[i] = inv[mod % i] * (mod - mod / i) % mod; f2[i] = f2[i - 1] * inv[i] % mod; } int T; cin >> T; while (T--) { int n; scanf ("%d", &n); LL res = 0; for (int i = n; i >= 0; i -= 2) { // cout << i << ' ' << C (n - i, (n - i) / 2) - C (n - i, (n - i) / 2 - 1) << endl; res += (C (n - i, (n - i) / 2) - C (n - i, (n - i) / 2 - 1) + mod) * C (n, i) % mod; } cout << res % mod << endl; } }