Arrangement#11552

Arrangement

1 second
128 megabytes
Medium

There are students in a class, of whom are girls. The teacher, Mr. X, wants to arrange all the students in a single row. He believes that the girls in his class are too talkative, so he does not want any two girls to stand next to each other.

Mr. X wants to know in how many different ways he can arrange all students in a row while satisfying this condition. Help him find the answer.

Input

The first line contains the number of test cases t~(1 \le t \le 10^5). Each of the following lines contains two integers and n~(1 < n \le m \le 10^6).

Output

For each test case, print one integer — the number of valid arrangements modulo 10^9 + 7.

Examples

Example 1

Loading
Loading