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. 
import java.awt.PageAttributes;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.PriorityQueue;
import java.util.Queue;
import java.util.StringTokenizer;
import java.util.TreeSet;

public class A {
	static int n;
	static int[] a;
	static int[] b;

	static int[][] memo;
	static HashMap<Integer, Integer> hm;

	static int dp(int idxA, int idxB) {
		if (idxA == n || idxB == n)
			return 0;
		if (memo[idxA][idxB] != -1)
			return memo[idxA][idxB];
		int l = dp(idxA + 1, idxB);
		int t = 0;
		int temp = hm.get(a[idxA]);
		if (temp >= idxB)
			t = 1 + dp(idxA + 1, temp + 1);
		return memo[idxA][idxB] = Math.max(l, t);
	}

	static int mod = 1000000007;

	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter pw = new PrintWriter(System.out);

		int t = sc.nextInt();
		int[] dimarr = new int[1001];
		int d = 1;
		for (int i = 1; i < dimarr.length; i++) {
			d  = (int) ((d*1l*i)%mod);
			dimarr[i]=modinverse(d, mod);
		}

		while (t-- > 0) {
			int n = sc.nextInt();
			int k = sc.nextInt();
			Integer[] a = new Integer[n];
			for (int i = 0; i < n; i++) {
				a[i] = sc.nextInt();
			}
			Arrays.sort(a, Collections.reverseOrder());

			int c = 0;
			for (int i = 0; i < k; i++) {
				if (a[i] == a[k - 1]) {
					c++;
				}
			}
			int u = c;
			for (int i = k; i < n; i++) {
				if (a[i] == a[k - 1]) {
					u++;
				}
			}
			
			int ans = 0;
			int num = 1;
			for (int i = 0; i < c; i++) {
				num = (int) ((num * 1l * (u-i)) % 1000000007);
			}
//			System.out.println(u+" "+c);
			pw.println((num*1l*dimarr[c])%mod);
			

		}

		pw.flush();
	}

	static class Scanner {
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream s) {
			br = new BufferedReader(new InputStreamReader(s));
		}

		public Scanner(String file) throws Exception {
			br = new BufferedReader(new FileReader(file));
		}

		public int[] intArr(int n) throws IOException {
			int a[] = new int[n];
			for (int i = 0; i < a.length; i++) {
				a[i] = nextInt();
			}
			return a;
		}

		public long[] longArr(int n) throws IOException {
			long a[] = new long[n];
			for (int i = 0; i < a.length; i++) {
				a[i] = nextLong();
			}
			return a;
		}

		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

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

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

		public String nextLine() throws IOException {
			return br.readLine();
		}

		public double nextDouble() throws IOException {
			String x = next();
			StringBuilder sb = new StringBuilder("0");
			double res = 0, f = 1;
			boolean dec = false, neg = false;
			int start = 0;
			if (x.charAt(0) == '-') {
				neg = true;
				start++;
			}
			for (int i = start; i < x.length(); i++)
				if (x.charAt(i) == '.') {
					res = Long.parseLong(sb.toString());
					sb = new StringBuilder("0");
					dec = true;
				} else {
					sb.append(x.charAt(i));
					if (dec)
						f *= 10;
				}
			res += Long.parseLong(sb.toString()) / f;
			return res * (neg ? -1 : 1);
		}

		public boolean ready() throws IOException {
			return br.ready();
		}

	}

	static int modinverse(int n, int p) {
		return modPow(n, p - 2, p);
	}

	static int modPow(int a, int e, int mod) // O(log e)
	{
		a %= mod;
		long res = 1;
		while (e > 0) {
			if ((e & 1) == 1)
				res = (res * a) % mod;
			a = (int) ((a * 1l * a) % mod);
			e >>= 1;
		}
		return (int) res;
	}

	static int far[], value[];

	static final long INF = (long) 1e18; // don't increase, avoid overflow
	static ArrayList<Edge>[] adjList, g;
	static int V;

	/*
	 * 1. Dijkstra's Algorithm for SSSP on weighted graphs
	 */
	static long[][] dijkstra(int S, int T) // O(E log E)
	{
		long[][] dist = new long[4][V];
		for (int i = 0; i < dist.length; i++) {
			Arrays.fill(dist[i], INF);
		}

		PriorityQueue<Edge> pq = new PriorityQueue<Edge>();
		dist[0][S] = 0;
		dist[1][S] = 0;
		dist[2][S] = 0;
		dist[3][S] = 0;
		pq.add(new Edge(S, 0)); // may add more in case of MSSP (Mult-Source)
		while (!pq.isEmpty()) {
//			System.out.println(pq);
			Edge cur = pq.remove();
			if (cur.free && cur.two) {
				if (cur.cost > dist[3][cur.node]) // lazy deletion
					continue;
			} else if (cur.free) {
				if (cur.cost > dist[1][cur.node]) // lazy deletion
					continue;
			} else if (cur.two) {
				if (cur.cost > dist[2][cur.node]) // lazy deletion
					continue;
			} else {
				if (cur.cost > dist[0][cur.node]) // lazy deletion
					continue;
			}
			for (Edge nxt : adjList[cur.node]) {
				if (cur.free && cur.two) {
					if (cur.cost + nxt.cost < dist[3][nxt.node]) // lazy deletion
						pq.add(new Edge(nxt.node, dist[3][nxt.node] = cur.cost + nxt.cost, true, true));
				} else if (cur.free) {
					if (cur.cost + nxt.cost < dist[1][nxt.node]) // lazy deletion
						pq.add(new Edge(nxt.node, dist[1][nxt.node] = cur.cost + nxt.cost, true, false));
					if (cur.cost + nxt.cost * 2 < dist[3][nxt.node]) // lazy deletion
						pq.add(new Edge(nxt.node, dist[3][nxt.node] = cur.cost + nxt.cost * 2, true, true));
				} else if (cur.two) {
					if (cur.cost + nxt.cost < dist[2][nxt.node]) // lazy deletion
						pq.add(new Edge(nxt.node, dist[2][nxt.node] = cur.cost + nxt.cost, false, true));
					if (cur.cost < dist[3][nxt.node]) // lazy deletion
						pq.add(new Edge(nxt.node, dist[3][nxt.node] = cur.cost, true, true));
				} else {
					if (cur.cost + nxt.cost < dist[0][nxt.node]) // lazy deletion
						pq.add(new Edge(nxt.node, dist[0][nxt.node] = cur.cost + nxt.cost, false, false));
					if (cur.cost < dist[1][nxt.node]) // lazy deletion
						pq.add(new Edge(nxt.node, dist[1][nxt.node] = cur.cost, true, false));
					if (cur.cost + nxt.cost * 2 < dist[2][nxt.node]) // lazy deletion
						pq.add(new Edge(nxt.node, dist[2][nxt.node] = cur.cost + nxt.cost * 2, false, true));
					if (cur.cost + nxt.cost < dist[3][nxt.node]) // lazy deletion
						pq.add(new Edge(nxt.node, dist[3][nxt.node] = cur.cost + nxt.cost, true, true));
				}
			}
		}
		return dist;

	}

	static class Edge implements Comparable<Edge> {
		int node;
		long cost;
		boolean free, two;

		Edge(int a, int b) {
			node = a;
			cost = b;
		}

		Edge(int a, long b, boolean f, boolean g) {
			node = a;
			cost = b;
			free = f;
			two = g;
		}

		@Override
		public String toString() {
			// TODO Auto-generated method stub
			return node + " " + cost + " " + free + " " + two;
		}

		public int compareTo(Edge e) {
			return Long.compare(cost, e.cost);
		}
	}

	static class pair implements Comparable<pair> {
		int x;
		int y;
		int idx;

		public pair(int d, int u, int i) {
			x = d;
			y = u;
			idx = i;
		}

		@Override
		public int compareTo(pair o) {
			// TODO Auto-generated method stub
			if (o.x == x)
				return o.y - y;
			return o.x - x;
		}

		@Override
		public String toString() {
			// TODO Auto-generated method stub
			return x + " " + y;
		}

	}
}