Random Walk That Never Goes Negative

No attempts yetTime limit2sMemory limit64 MB

Problem

Seonyeong stands at the origin of a very long line. In one move she can step one square to the left or one square to the right.

The number of random walks that use 2N2N moves and end at the starting square is (2NN)\binom{2N}{N}. Coming back to the start forces the number of left moves to equal the number of right moves, so the walk makes NN moves right and NN moves left, and only their order is free.

In that version Seonyeong can stand on a negative coordinate. Write a program that counts the walks once the extra rule "never move to a negative coordinate" is added. For N=1N = 1 she can walk 0100 \to 1 \to 0, but she cannot walk 0100 \to -1 \to 0.

Input

The first line contains the number of test cases TT (T1,000T \le 1{,}000). Each of the next TT lines contains the value NN (1N1,000,0001 \le N \le 1{,}000{,}000) of one test case.

Output

For each test case, print the number of random walks that return to the starting square without ever visiting a negative coordinate, modulo 1,000,000,007. Print one answer per line.