Counting Polygons

아직 제출이 없습니다시간 제한2초메모리 제한256 MB

문제

Mr. Panda loves counting polygons. One day, he drew a circle with the unit radius and set nn points on the circle such that these points divide the circle into nn arcs with equal length. He is wondering how many different convex polygons he could generate if he selects mm points from these nn points and connects every two adjacent selected points with a line segment.

Two polygons are different if and only if they are not congruent. Two selected points are adjacent if there exist no other selected points on the arc between them. To avoid huge output data, you are only asked the answer modulo (109+7)(10^9 + 7).

입력

There are multiple test cases. The first line of the input contains an integer TT (1T1041 \le T \le 10^4), indicating the number of test cases. For each test case:

The first line contains two integers nn and mm (3mn1073 \leq m \leq n \leq 10^7).

출력

For each test case, output the number of different polygons modulo (109+7)(10^9 + 7) in a single line.