G. Count Mix Strings
time limit per test
3 seconds
memory limit per test
512 megabytes
input
standard input
output
standard output

While I was working in the company, the internet broke. I didn't have anything to do without internet, so I decided to write this ACM problem.

We need to mix between two strings and also we should keep the same order for both strings.

example: if we have s1 = "ab" and s2 = "cd", we can generate six strings:

abcd acbd

acdb cdab

cadb cabd

but now I have a problem. I need to calculate the complexity for this problem to make input and output files.

you will be given the length of two strings and you should help me to find the number of strings that could be generated (if there is a repeated string, count it every time).

Input

Your program will be tested on one or more test cases. The first line of the input will be a single integer T, the number of test cases (1 ≤ T ≤ 10000). Followed by the test cases, each test case is on one line. it contains two numbers N and M the length of s1 and s2 where 1 ≤ N, M ≤ 10000

Output

For each test case, print a single line which contains a single integer that is representing the number of strings that could be generated MOD 10^9+7.

Examples
Input
3
1 1
1 2
2 2
Output
2
3
6