CSES - Binomial Coefficients
  • Time limit: 1.00 s
  • Memory limit: 512 MB

Your task is to calculate nn binomial coefficients modulo 109+710^9+7.

A binomial coefficient (ab){a \choose b} can be calculated using the formula a!b!(ab)!\frac{a!}{b!(a-b)!}. We assume that aa and bb are integers and 0ba0 \le b \le a.

Input

The first input line contains an integer nn: the number of calculations.

After this, there are nn lines, each of which contains two integers aa and bb.

Output

Print each binomial coefficient modulo 109+710^9+7.

Constraints

  • 1n1051 \le n \le 10^5
  • 0ba1060 \le b \le a \le 10^6

Example

Input:

3
5 3
8 1
9 5

Output:

10
8
126