P15094 [HackerEarth] Watson asks Sherlock:
普及
题目描述

Watson asks Sherlock:
Given a string S of N 0's and M 1's, how many unique permutations of this string start with 1?

Help Sherlock by printing the answer modulo (109+7).

Input Format:

First line contains T, the number of test cases.
Each test case consists of N and M separated by a space.

Output Format:

For each test case, print the answer modulo (109+7).

Constraints: 

1 ≤ T ≤ 200
1 ≤ N,M ≤ 1000

SAMPLE INPUT
2
1 1
2 3

SAMPLE OUTPUT
1
6

输入格式

见题面

输出格式

见题面

样例输入
5 7 9 3 8 6 4 1 8 6 9
样例输出
6 29 35 1 10