Joseph loves questions with arrays! His friend Nick gave him interesting problem!
Initially, there is an array with n positive integers, numbered 1 through n. Let quality be a multiplication of all integers from the array. More formally, quality = a1 * a2 * a3 * ... * an. Nick is interested in number of arrays with size of k with same quality.
Of course, Joseph found that this problem is really hard for him. So, he needs your help.
Input format
The first line contains a single integer n and k — the number of positive integers in the array and the size of the arrays you have to count, respectively.
The next line contains n integers a1, a2, ..., an — an array which was described above.
Output format
Print the answer modulo 109 + 7.
Note: The numbers in all k-sized arrays must be positive.
Constraints
- 1 <= n, k <= 105
- 1 <= ai <= 106
Subtasks
- Subtask #1 (10 points) : n, k <=10 and the quality <= 10
- Subtask #2 (90 points) : Original constraints
Please login to use the editor
You need to be logged in to access the code editor
Loading...
Please wait while we load the editor
Login to unlock the editorial