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. 
// package eround101;

import java.util.*;
import java.io.*;
import java.lang.*;
import java.util.StringTokenizer;

public class C101 {

    static HritikScanner sc = new HritikScanner();
    static  PrintWriter pw = new PrintWriter(System.out,true);
    final static int MOD = (int) (1e9 + 7);
    static int[] count = new int[1000001];
    
        public static void main(String[] args) {

        int t = sc.nextInt();
        while (t-- > 0)
            solve();
        }

     static void solve(){
//      StringBuilder sb = new StringBuilder();
//        int n = ni();      
//      int[] a = new int[n];
        int a = ni();
        
         int k = ni();
        int[] arr = new int[a];
    
        int[] carr = new int[a+1];
         int[] carr1 = new int[a+1];
        for(int i = 0; i < a; i++)
        {
            arr[i] = ni();
            carr[arr[i]]++;
            carr1[arr[i]]++;
        }
        long ans = 0;
//         pa(carr);
//        Arrays.sort(carr1);
//        if(carr1[carr1.length - 2] == 0)
//        {
//            ans = nCr(carr1[carr1.length - 1], k);
//            pl(ans);
//            return;
//        }
       
     
        Arrays.sort(arr);
        HashSet<Integer> hset = new HashSet<>();
        for(int i = arr.length-1; i >= arr.length - k ; i--)
        {
            if(arr[i] != arr[arr.length - k])
                hset.add(arr[i]);
            
//            ans = ans%((int)Math.pow(10, 9)+7);
        }
        int m = 0;
        for(int ele : hset)
        {
//            p(ele);
//                    pl();
            m += carr[ele];
//            pl(m);
        }
         if(carr[arr[arr.length-k]] == k-m)
         {
             pl(1);
             return;
         }
        ans = nCr(carr[arr[arr.length-k]], k - m)%((int)Math.pow(10, 9)+7);
        pl(ans);
    }
    
    
    
    
    /////////////////////////////////////////////////////////////////////////////////
    
    static int ni() 
    {
        return sc.nextInt();
    }
    static long nl() 
    {
        return sc.nextLong();
    }
    static double nd() 
    {
        return sc.nextDouble();
    }
    
    /////////////////////////////////////////////////////////////////////////////////
    
    static void pl()
    {
        pw.println();
    }
    static void p(Object o)
    {
        pw.print(o);
    }
    static void pl(Object o)
    {
        pw.println(o);
    }
    static void psb(StringBuilder sb)
    {
        pw.print(sb);
    }
    static void pa(Object arr[])
    {
        for(Object o : arr)
            p(o);
        pl();
    }
    static void pa(int arr[])
    {
        for(int o : arr)
            p(o);
        pl();
    }
    static void pa(long arr[])
    {
        for(long o : arr)
            p(o);
        pl();
    }
    static void pa(double arr[])
    {
        for(double o : arr)
            p(o);
        pl();
    }
    static void pa( char arr[])
    {
        for(char o : arr)
            p(o);
        pl();
    }
    static void pa(List list)
    {
        for(Object o : list)
            p(o);
        pl();
    }
    static void pa(Object[][] arr) {
     
        for(int i=0;i<arr.length;++i) {
            for(Object o : arr[i])
                p(o);
            pl();
        }
    }
    static void pa(int[][] arr) {
        for(int i=0;i<arr.length;++i) {
            for(int o : arr[i])
                p(o);
            pl();
        }
    }
    static void pa(long[][] arr) {
        for(int i=0;i<arr.length;++i) {
            for(long o : arr[i])
                p(o);
            pl();
        }
    }
    static void pa(char[][] arr) {
        for(int i=0;i<arr.length;++i) {
            for(char o : arr[i])
                p(o);
            pl();
        }
    }
    static void pa(double[][] arr) {
        for(int i=0;i<arr.length;++i) {
            for(double o : arr[i])
                p(o);
            pl();
        }
    }

/////////////////////////////////////////////////////////////////////////////////


    

    static void print(Object s) {
        System.out.println(s);
    }
    
    
    
    /////////////////////////////////////////////////////////////////////////////////

    
    //-----------HritikScanner class for faster input----------//
    static class HritikScanner {

        BufferedReader br;
        StringTokenizer st;

        public HritikScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }
    
    

    //////////////////////////////////////////////////////////////////
    public static class Pair implements Comparable<Pair> {

        int h, w, index;

        Pair(int h, int w) {
            this.h = h;
            this.w = w;
            
        }

        public int compareTo(Pair A) {
            if (A.h == this.h) {
                return this.w - A.w;
            }
            return this.h - A.h;
        }
    }
    
     //////////////////////////////////////////////////////////////////
    
    // Function to return gcd of a and b time complexity O(log(a+b))
    static int gcd(int a, int b) 
    { 
        if (a == 0) 
            return b; 
        return gcd(b % a, a); 
    } 
    
      //////////////////////////////////////////////////////////////////

    static boolean isPrime(long n) 
    { 
        // Corner cases 
        if (n <= 1) return false; 
        if (n <= 3) return true; 
      
        // This is checked so that we can skip  
        // middle five numbers in below loop 
        if (n % 2 == 0 || n % 3 == 0) return false; 
      
        for (long i = 5; i * i <= n; i = i + 6) 
            if (n % i == 0 || n % (i + 2) == 0) 
            return false; 
      
        return true; 
    } 
    static boolean isPowerOfTwo(long n)
    {
        if(n==0)
        return false;
 
        return (long)(Math.ceil((Math.log(n) / Math.log(2)))) == 
         (long)(Math.floor(((Math.log(n) / Math.log(2)))));
    }
//    static int nCr(int n, int r) 
//{ 
//    return fact(n) / (fact(r) * 
//                  fact(n - r)); 
//} 
//  
//// Returns factorial of n 
//static int fact(int n) 
//{ 
//    int res = 1; 
//    for (int i = 2; i <= n; i++) 
//        res = res * i; 
//    return res; 
//} 
    public static long getFact(int n){
        long ans = 1;
        while (n > 0){
            ans *= n;
            ans %= MOD;
            n--;
        }
        return ans;
    }
    public static long pow(long n, int pow){
        if (pow == 0)
            return 1;
        long temp = pow(n, pow/2)%MOD;
        temp *= temp;
        temp %= MOD;
        if (pow % 2 == 1)
            temp *= n;
        temp %= MOD;
        return temp;
 
    }
    public static long nCr(int n, int r){
        long ans = 1;
        int temp = n-r;
        while (n > temp){
            ans *= n;
            ans %= MOD;
            n--;
        }
        ans *= pow(getFact(r)%MOD, MOD-2)%MOD;
        ans %= MOD;
        return ans;
    }
    

}
