Wanted: Second Sock
time limit per test
1 second
memory limit per test
1024 mebibytes
input
standard input
output
standard output

Nikita is preparing for a competition. The most challenging part of this task is to find a pair of matching socks. In the drawer, there are $$$p$$$ different pairs of socks, as well as $$$m$$$ single socks whose pairs he has lost long ago. Nikita takes socks one by one until he finds two matching socks among those he has pulled out. What is the expected number of socks Nikita will pull out?

Calculate this expected value modulo the prime number $$$10^9 + 7$$$. Specifically, if the answer is a rational number $$$x / y$$$, you need to output a number $$$a$$$ such that $$$0 \le a < 10^9 + 7$$$ and $$$a \cdot y = x \pmod{10^9 + 7}$$$.

Input

The first line contains an integer $$$t$$$: the number of test cases ($$$1 \le t \le 10^4$$$). The following lines describe the test cases.

Each test case is given on a separate line containing two integers $$$p$$$ and $$$m$$$: the number of pairs of socks and the number of single socks in the drawer ($$$1 \le p \le 10^6$$$; $$$0 \le m \le 10^6$$$).

Output

For each test case, output a line containing a single integer: the answer to the problem.

Example

Input
1
1 1
Output
666666674

Note

In the first test case, the expected value is $$$8 / 3$$$, which equals $$$666\,666\,674$$$ modulo $$$10^9 + 7$$$.