#include #include #include #include using namespace std; typedef long long i64; const int N = 2e6 + 10; const int Mod = 1e9 + 7; i64 fac[N], inv[N], ans[N]; i64 Binom(int m, int n) { if (m < n) return 0; return fac[m] * inv[n] % Mod * inv[m - n] % Mod; } i64 Power(i64 a, i64 b) { i64 c = 1; for (; b; b >>= 1) { if (b & 1) (c *= a) %= Mod; (a *= a) %= Mod; } return c; } int main() { fac[0] = inv[0] = 1; for (int i = 1; i < N; ++i) fac[i] = fac[i - 1] * i % Mod; inv[N - 1] = Power(fac[N - 1], Mod - 2); for (int i = N - 2; i; --i) inv[i] = inv[i + 1] * (i + 1) % Mod; for (int j = 0; j < N; ++j) ans[j] = (Binom(2 * j, j) * inv[j + 1] % Mod * fac[j] % Mod + Mod) % Mod; int tcase; scanf("%d", &tcase); while (tcase--) { int n; scanf("%d", &n); i64 Ans = 0; for (int i = 0; i <= n; ++i) { int j = n - i; if (j & 1) continue; j /= 2; i64 sum = Binom(n, i); (sum *= ans[j]) %= Mod; (Ans += sum) %= Mod; } (Ans += Mod) %= Mod; printf("%I64d\n", Ans); } return 0; }