Masha works in an advertising agency. In order to promote the new brand, she wants to conclude contracts with some bloggers. In total, Masha has connections of n different bloggers. Blogger numbered i has a_i followers.

Since Masha has a limited budget, she can only sign a contract with k different bloggers. Of course, Masha wants her ad to be seen by as many people as possible. Therefore, she must hire bloggers with the maximum total number of followers.

Help her, find the number of ways to select k bloggers so that the total number of their followers is maximum possible. Two ways are considered different if there is at least one blogger in the first way, which is not in the second way. Masha believes that all bloggers have different followers (that is, there is no follower who would follow two different bloggers).

For example, if n=4, k=3, a=[1, 3, 1, 2], then Masha has two ways to select 3 bloggers with the maximum total number of followers: 

  * conclude contracts with bloggers with numbers 1, 2 and 4. In this case, the number of followers will be equal to a_1 + a_2 + a_4 = 6. 
  * conclude contracts with bloggers with numbers 2, 3 and 4. In this case, the number of followers will be equal to a_2 + a_3 + a_4 = 6. 



Since the answer can be quite large, output it modulo 10^9+7.

Input

The first line contains one integer t (1 ≤ t ≤ 1000) — the number of test cases. Then t test cases follow.

The first line of each test case contains two integers n and k (1 ≤ k ≤ n ≤ 1000) — the number of bloggers and how many of them you can sign a contract with.

The second line of each test case contains n integers a_1, a_2, … a_n (1 ≤ a_i ≤ n) — the number of followers of each blogger.

It is guaranteed that the sum of n over all test cases does not exceed 1000.

Output

For each test case, on a separate line output one integer — the number of ways to select k bloggers so that the total number of their followers is maximum possible.

Example

Input


3
4 3
1 3 1 2
4 2
1 1 1 1
2 1
1 2


Output


2
6
1

Note

The test case is explained in the statements.

In the second test case, the following ways are valid: 

  * conclude contracts with bloggers with numbers 1 and 2. In this case, the number of followers will be equal to a_1 + a_2 = 2; 
  * conclude contracts with bloggers with numbers 1 and 3. In this case, the number of followers will be equal to a_1 + a_3 = 2; 
  * conclude contracts with bloggers with numbers 1 and 4. In this case, the number of followers will be equal to a_1 + a_4 = 2; 
  * conclude contracts with bloggers with numbers 2 and 3. In this case, the number of followers will be equal to a_2 + a_3 = 2; 
  * conclude contracts with bloggers with numbers 2 and 4. In this case, the number of followers will be equal to a_2 + a_4 = 2; 
  * conclude contracts with bloggers with numbers 3 and 4. In this case, the number of followers will be equal to a_3 + a_4 = 2. 



In the third test case, the following ways are valid: 

  * concludes a contract with a blogger with the number 2. In this case, the number of followers will be equal to a_2 = 2. 
#include <bits/stdc++.h>
using namespace std;
#define int long long int
#define pb push_back
#define mp make_pair
#define vi vector<int>
#define pii pair<int, int>
#define vpii vector<pair<int, int>>
#define mod 1000000007 //(10power9)+7
#define MAXN 1000005
#define inf 100000000000000000
#define N 1000005
int spf[MAXN];
// vector<int> graph[1000000];
vector<int> moreprimes;
vector<int> smallest_factor;
vector<bool> prime;
vector<int> primes;

void sieve(int maximum)
{
    maximum = max(maximum, 1ll);
    smallest_factor.assign(maximum + 1, 0);
    prime.assign(maximum + 1, true);
    prime[0] = prime[1] = false;
    primes = {};

    for (int p = 2; p <= maximum; p++)
        if (prime[p])
        {
            smallest_factor[p] = p;
            primes.push_back(p);

            for (int64_t i = int64_t(p) * p; i <= maximum; i += p)
                if (prime[i])
                {
                    prime[i] = false;
                    smallest_factor[i] = p;
                }
        }
}

const int P_MAX = int64_t(1e5) + 5;
const int64_t INF64 = int64_t(2e18) + 5;
void moreprimesneeded()
{
    bitset<10000005> b;
    b.set(); // al 1,1,1,1,1,1,..
    b[0] = b[1] = 0;
    for (int i = 2; i <= 10000000; i++)
    {
        if (b[i] == 1)
        {
            moreprimes.push_back(i);
            for (int j = i * i; j <= 10000000; j += i)
            {
                b[j] = 0;
            }
        }
    }
}

#define IOS                  \
    ios::sync_with_stdio(0); \
    cin.tie(0);              \
    cout.tie(0);

// void SecondSieve(int arr[])
void niceSieve(int *primes)
{
    // prime is 1.
    // non primes are 0.

    primes[0] = primes[1] = 0;
    // mark all as prime first.
    for (int i = 2; i < N; i++)
    {
        primes[i] = 1;
    }
    for (int i = 2; i < N; i++)
    {
        if (primes[i] == 1)
        {
            for (int j = i * i; j < N; j += i)
            {
                primes[j] = 0;
            }
        }
    }
}
//calculate direct prime factors  example >>>>24=2*2*2*3 in o(sqrt(n)) for an input no. n
// This worked for  5000  test cases and sigma (n)<= (10power10)
vector<int> primeFactors(int n)
{
    // Print the number of 2s that divide n
    vector<int> v;
    while (n % 2 == 0)
    {
        // cout << 2 << " ";
        v.push_back(2);
        n = n / 2;
    }

    // n must be odd at this point. So we can skip
    // one element (Note i = i +2)
    for (int i = 3; i <= sqrt(n); i = i + 2)
    {
        // While i divides n, print i and divide n
        while (n % i == 0)
        {
            // cout << i << " ";
            v.push_back(i);
            n = n / i;
        }
    }

    // This condition is to handle the case when n
    // is a prime number greater than 2
    if (n > 2)
        // cout << n << " ";
        v.push_back(n);
    return v;
}

//  calculate  sieve ...in lowest time possible...

// SPF[ ] :>>>>> stores smallest prime factor for every number
// Calculating SPF (Smallest Prime Factor) for every
// number till MAXN.
// Time Complexity : O(nloglogn)
void sieveapni()
{
    spf[1] = 1;
    for (int i = 2; i < MAXN; i++)

        // marking smallest prime factor for every
        // number to be itself.
        spf[i] = i;

    // separately marking spf for every even
    // number as 2
    for (int i = 4; i < MAXN; i += 2)
        spf[i] = 2;

    for (int i = 3; i * i < MAXN; i++)
    {
        // checking if i is prime
        if (spf[i] == i)
        {
            // marking SPF for all numbers divisible by i
            for (int j = i * i; j < MAXN; j += i)

                // marking spf[j] if it is not
                // previously marked
                if (spf[j] == j)
                    spf[j] = i;
        }
    }
}

vector<pair<int, int>> getFactorizationinPairs(int x)
{
    vector<pair<int, int>> ret;
    while (x != 1)
    {
        if (ret.size() == 0)
        {
            ret.push_back(make_pair(spf[x], 1));
        }
        else if (ret.back().first == spf[x])
        {
            ret.back().second++;
        }
        else if (ret.back().first != spf[x])
        {
            ret.push_back(make_pair(spf[x], 1));
        }

        // ret.push_back(spf[x]);
        x = x / spf[x];
    }
    return ret;
}
//below code uses sieve to return primes of a no in log(n) times
//ONLY GOOD FOR UPTO X=POWER(10,6)
// A O(log n) function returning primefactorization
//EXAMPLE  24=2*2*2*3 SO RETURNED VECTOR CONTAIN 2,2,2,3
// by dividing by smallest prime factor at every step
vector<int> getFactorization(int x)
{
    vector<int> ret;
    while (x != 1)
    {
        ret.push_back(spf[x]);
        x = x / spf[x];
    }
    return ret;
}

/* Iterative Function to calculate (x^y)%p
in O(log y) */
unsigned long long power(unsigned long long x, int y, int p)
{
    unsigned long long res = 1; // Initialize result

    x = x % p; // Update x if it is more than or
    // equal to p

    while (y > 0)
    {

        // If y is odd, multiply x with result
        if (y & 1)
            res = (res * x) % p;

        // y must be even now
        y = y >> 1; // y = y/2
        x = (x * x) % p;
    }
    return res;
}

// Returns n^(-1) mod p
unsigned long long modInverse(unsigned long long n, int p)
{
    return power(n, p - 2, p);
}

// Returns nCr % p using Fermat's little
// theorem.
unsigned long long nCrModPFermat(unsigned long long n, int r, int p)
{
    // If n<r, then nCr should return 0
    if (n < r)
        return 0;
    // Base case
    if (r == 0)
        return 1;

    // Fill factorial array so that we
    // can find all factorial of r, n
    // and n-r
    unsigned long long fac[n + 1];
    fac[0] = 1;
    for (int i = 1; i <= n; i++)
        fac[i] = (fac[i - 1] * i) % p;

    return (fac[n] * modInverse(fac[r], p) % p * modInverse(fac[n - r], p) % p) % p;
}

//calculate ncr directly without any mod  with a prime number...
int ncr(int n, int r)
{
    int ans = 1;
    int x = 1;
    while (x <= r)
    {
        ans = ans * n / x;
        x++;
        n--;
    }

    return ans;
}

//calculate direct factorial...
int fact(int n)
{
    int ans = 1;
    while (n >= 1)
    {
        ans = ans * n;
        n--;
    }
    return ans;
}

//  calculate  a power to b  (a^^b)  very fast  along with mod
int fastApowB(int base, int exp)
{
    base %= mod;
    int result = 1;
    while (exp > 0)
    {
        if (exp & 1)
            result = (result * base) % mod;
        base = (base * base) % mod;
        exp >>= 1;
    }
    return result;
}

// // Takes graph inputs...
// void graphInput(int a[], int b[])
// {
//     // int  u, v;
//     // int i = 0;
//     // // while (m--)
//     // {
//     //     // cin >> u >> v;
//     //     graph[u].pb(v);
//     //     graph[v].pb(u);
//     // }
// }

//  make a depth first search...
// void dfs(int u, int par)
// {
//     for (int v : graph[u])
//     {
//         if (v == par)
//             continue;
//         dfs(v, u);
//     }
// }

//  Calculates all possible divisors of the given number...
vector<int> divisors(int n)
{
    vector<int> ans;
    for (int i = 1; i * i <= n; i++)
    {
        if (n % i == 0)
        {
            if (n / i == i)
                ans.push_back(i);

            else
            {
                ans.push_back(i);
                ans.push_back(n / i);
            }
        }
    }

    return ans;
}
vector<int> graph[200005];
// Our Driver Code
int32_t main()
{
    IOS

        int t;
    cin >> t;

    while (t--)
    {
        int n, k;
        cin >> n >> k;
        int a[n];
        for (int i = 0; i < n; i++)
        {
            cin >> a[i];
        }
        sort(a, a + n);
        vector<pair<int, int>> v;
        for (int i = 0; i < n; i++)
        {
            if (v.size() == 0 || a[i] != v.back().first)
            {
                v.push_back(make_pair(a[i], 1));
            }
            else if (a[i] == v.back().first)
            {
                v.back().second++;
            }
        }

        int s = v.size();

        // int suffixsums[s]={0};

        int keep = 0;
        int p = s;
        while (keep < k)
        {
            p--;
            keep += v[p].second;
        }
        if (keep == k)
        {
            cout << "1\n";
        }
        else if (keep > k)
        {
            int Nn = v[p].second;
            int r = k-(keep-v[p].second);
            cout << nCrModPFermat(Nn, r, mod) << "\n";
        }
    }
    return 0;
}
