No Max No Min
You have an array with n elements. you have to create all subsequences of this array with length K. For each subsequence, you have to write down the product of k-2 integers, all elements of this sequence except the minimum and maximum element. your work will be considered done if you will be able to write down all these numbers and tell PepBoss their product mod 10^9+7.
1<= N <= 5000 3 <= K <= N 1 <= arr[i] <= 10000
The first line contains integer N (length of array) and K. The second line contains N space separated integers.
Print a single line containing one integer - the product of all numbers written down by you modulo 10^9+7.
4 3 1 2 3 4