Monke likes mind-boggling functions that even a genius like him can't solve. The function is the following —
Monke tried to write a code that finds $$$f(k, x)$$$ $$$\bmod$$$ $$$10^9 + 7$$$. When he runs that code, his computer catches on fire, he loses his mind and comes to you. Now, to calm him down (and to also prove you're more of a genius than him), you have to write a code that can calculate $$$f(k, x)$$$ $$$modulo$$$ $$$10^9 + 7$$$, which doesn't burn Monke's computer.
The first line of input contains $$$t(1 \leq t\leq 10^5)$$$ — the number of test cases.
Each test case contains two integers $$$k, x (1 \leq k, x \leq 3\cdot10^5)$$$.
Print $$$f(k, x) \bmod 10^9+7$$$.
31 11952 197169420 42069
1 537162777 817139390
| Name |
|---|


