#include #include #include #include #include #include #include using namespace std; typedef long long ll; const int Maxn=1e6+5,P=1e9+7,T=1e6; ll jc[Maxn],jcny[Maxn]; ll f[Maxn],ans,CC[Maxn]; ll Pow(ll x,int y) { ll tmp=1; while(y) { if (y&1) tmp=tmp*x%P; y/=2;x=x*x%P; } return tmp; } ll C(int m,int n) { return jc[m]*jcny[n]%P*jcny[m-n]%P; } int main() { //freopen(".in","r",stdin); //freopen(".out","w",stdout); int i,j; jc[0]=1; for (i=1;i<=T;i++) jc[i]=jc[i-1]*i%P; jcny[T]=Pow(jc[T],P-2); for (i=T-1;i>=0;i--) jcny[i]=jcny[i+1]*(i+1)%P; f[0]=1;for (i=2;i<=T;i+=2) f[i]=(C(i,i/2)-C(i,i/2-1)+P)%P; //for (i=1;i<=T;i++) f[i]=(f[i-1]+f[i])%P; int T,n; ll last; scanf ("%d",&T); while(T--) { scanf ("%d",&n); ans=1; for (int i=2;i<=n;i+=2) { ans=(ans+f[i]*C(n,i))%P; } cout<