#include #define N 2001000 #define mod 1000000007 int C[N], p[N], ip[N]; void ext(int a, int b, int &x, int &y) { if(!b) { x = 1; y = 0; return; } ext(b, a % b, x, y); x = y % b; if(x < 0) x += b; y = (1LL - 1LL * a * x) / b; } void init() { p[0] = ip[0] = 1; for(int i = 1; i < N; i ++) { p[i] = 1LL * i * p[i-1] % mod; int x; ext(p[i], mod, ip[i], x); } C[0] = 1; for(int i = 1; i < N / 2 - 1; i ++) { int x = 1LL * p[2 * i] * ip[i] % mod; x = 1LL * x * ip[i] % mod; int y, z; ext(i + 1, mod, z, y); C[i] = 1LL * x * z % mod; } } int cc(int n, int m) { int rt = 1LL * p[n] * ip[m] % mod; return 1LL * rt * ip[n-m] % mod; } int main() { //freopen("in.txt", "r", stdin); init(); int T; scanf("%d", &T); while(T --) { int n; scanf("%d", &n); int ans = 0; for(int i = 0; i <= n; i += 2) { ans += 1LL * C[i/2] * cc(n, i) % mod; if(ans >= mod) ans -= mod; } printf("%d\n", ans); } return 0; }