#include #include #include using namespace std; typedef long long ll; const ll mod = 1000000007; ll inv[1200000]; ll h[1200000]; ll frac[1200000]; ll inv_frac[1200000]; ll z[1200000]; ll C(int n, int m) { ll t = inv_frac[n-m] * inv_frac[m] % mod; return t * frac[n] % mod; } int main() { inv[1] = 1; for(int i=2; i<=1100000; ++i) inv[i] = (mod - mod/i) * inv[mod%i] % mod; h[0] = h[1] = 1; for(int i=2; i<=1100000; ++i) { h[i] = (4*i-2) * h[i-1] % mod; h[i] = h[i] * inv[i+1] % mod; } frac[0] = frac[1] = 1; inv_frac[0] = inv_frac[1] = 1; for(int i=2; i<=1100000; ++i) { frac[i] = frac[i-1] * i % mod; inv_frac[i] = inv_frac[i-1] * inv[i] % mod; } int T; scanf("%d", &T); while(T--) { int n; scanf("%d", &n); ll ans = 0; for(int i=0; 2*i<=n; ++i) { ans += C(n, 2*i) * h[i] % mod; ans %= mod; } printf("%I64d\n", ans); } return 0; }