Given a set of  N  natural numbers 1,2,3........N and Q query.For each query you have to calculate the total number of subset in which  Ith.
number of set come at Kth postion.Elements of every subset should be in sorted order.
The answer could  be very large so you have to print answer modulo 1e9+7.


-----Input:-----
- The first line of input cotains a single integer T denoting the number of test cases.
- For every test case it contains two number N and Q.
- Next Q line contains two number I and K.

-----Output:-----
For each test case print required answer.

-----Constraints and Subtasks:-----
- 1<=T<=5
- 1<=N, K<=4000
- 1<=Q<=1000000
Subtask 3: 5 points
- 1<=T<=5
- 1<=N, K<=16
- 1<=Q<=1000
Subtask 1: 25 points
- T=1
- 1<=N, K<=4000
- 1<=Q<=100000
Subtask 2: 70 points
- Original Constraints.

-----Example:-----
Input:

1

3 3

1 2

2 1

3 2

Output:

0

2

2

-----Explanation:-----
For N=3

total subsets are:

{1}

{2}

{3}

{1,2}

{1,3}

{2,3}

{1,2,3}

Now we can see that for I=1 and K=2 there is no subset in which 1 come at 2nd position so the answer is Zero for that query.

For 2nd query I=2 and K=1 there are two subset i.e {2,3} and {2} in which 2 come at 1st position.

Same for 3rd querry there is two subset i.e{1,3} and {2,3}.

```python

USER_FILENAME = "<user_code>"
import sys, json, builtins
import math, heapq, bisect, itertools, functools, collections, statistics, fractions, decimal, operator, array, random, re, string, os, pathlib
try:
    import resource as _res
except Exception:
    _res = None
from collections import Counter, defaultdict, deque, OrderedDict
from functools import lru_cache, reduce
from itertools import accumulate, permutations, combinations, product
from math import gcd, ceil, floor, sqrt
from decimal import Decimal
try:
    from typing import *
except Exception:
    pass
try:
    sys.setrecursionlimit(1_000_000)
except Exception:
    pass
try:
    import site as _site
    try:
        _sys_sites = _site.getsitepackages() if hasattr(_site, "getsitepackages") else []
        for _p in _sys_sites:
            if _p and _p not in sys.path:
                sys.path.append(_p)
    except Exception:
        pass
    try:
        _usp = _site.getusersitepackages()
        if isinstance(_usp, str):
            _usp = [_usp]
        for _p in _usp:
            if _p and _p not in sys.path:
                sys.path.append(_p)
    except Exception:
        pass
except Exception:
    pass

ns = {"__name__": "__main__"}
for _k, _v in list(globals().items()):
    if not _k.startswith("_"):
        ns[_k] = _v
_CODE = "z=(10**9+7)\n\ncachencr={}\ncachepow={}\nfact=[]\nfact.append(1)\nfor i in range(1,4000):\n fact.append(i*fact[i-1]%z)\n\ndef factorialMod(n):\n ans=1\n for i in range(1,n+1):\n  ans = ans * i % z \n return ans % z\n \ndef nCr(n,r):\n if r>n:\n  return 0\n key = str(n)+','+str(r)\n if key in cachencr:\n  return cachencr[key]\n else:\n  cachencr[key]=fact[n]*pow(fact[r]*fact[n - r], z - 2, z) % z\n  return cachencr[key]\n  \ndef powc(n):\n if n in cachepow:\n  return cachepow[n]\n else:\n  cachepow[n] = pow(2,n,z)\n  return cachepow[n]\n \nfor _ in range(0,int(input())):\n n,q = list(map(int,input().split()))\n for __ in range(0,q):\n  i,k= list(map(int,input().split()))\n  a = nCr(i-1,k-1)\n  b = powc(n-i)\n  print((a*b)% z)"
_co = compile(_CODE, USER_FILENAME, "exec")
exec(_co, ns, ns)

```

Measured memory_bytes: 174821