#include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define getmid(l,r) ((l) + ((r) - (l)) / 2) #define MEM(a,b) memset(a,b,sizeof(a)) #define MP(a,b) make_pair(a,b) #define PB push_back typedef long long ll; typedef pair pii; const double eps = 1e-8; const int INF = (1 << 30) - 1; const int mod = 1e9 + 7; const int MAXN = 1000010; int fac[MAXN],afac[MAXN]; int KK[MAXN]; map mp; int Q_pow(int x,int y){ int res = 1; while(y){ if(y & 1) res = 1ll * res * x % mod; x = 1ll * x * x % mod; y >>= 1; } return res % mod; //小心模数为1的情况 } void Pre(){ fac[0] = afac[0] = 1; for(int i = 1; i < MAXN; ++i) fac[i] = 1ll * fac[i - 1] * i % mod; afac[MAXN - 1] = Q_pow(fac[MAXN - 1],mod - 2); for(int i = MAXN - 1; i > 1; --i) afac[i - 1] = 1ll * afac[i] * i % mod; } int C(int n,int m){ return 1ll * fac[n] * afac[n - m] % mod * afac[m] % mod; } int K(int n){ return 1ll * C(2 * n,n) * Q_pow(n + 1,mod - 2) % mod; } int T,n; int main(){ Pre(); for(int i = 2; i <= 1000000; i += 2) KK[i] = K(i / 2); scanf("%d",&T); while(T--){ scanf("%d",&n); if(mp.find(n) != mp.end()){ printf("%d\n",mp[n]); continue; } int ans = 1; for(int i = 2; i <= n; i += 2){ ans = (ans + 1ll * C(n,i) * KK[i] % mod) % mod; } printf("%d\n",ans); mp[n] = ans; } return 0; }