#include <bits/stdc++.h>
using namespace std;
int n, k;
long long a[10005], pol[10005];
long long ksm(long long x, long long t) {
  long long ans = 1;
  while (t) {
    if (t & 1) ans = ans * x % 1000000007;
    x = x * x % 1000000007;
    t >>= 1;
  }
  return ans;
}
long long inv(long long x) { return ksm(x, 1000000007 - 2); }
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; i++) scanf("%lld", &a[i]);
  pol[0] = 1;
  for (int i = 1; i <= n; i++) {
    for (int j = n; j >= 1; j--)
      pol[j] =
          (pol[j] * a[i] % 1000000007 - pol[j - 1] + 1000000007) % 1000000007;
    pol[0] = pol[0] * a[i] % 1000000007;
  }
  long long ans = 0, frac = 1, pi = 1;
  for (int i = 1; i <= n; i++) pi = pi * a[i] % 1000000007;
  for (int i = 0; i <= n && i <= k; i++) {
    ans = (ans + ksm(n, k - i) * pol[i] % 1000000007 * frac) % 1000000007;
    frac = frac * (k - i) % 1000000007;
  }
  cout << (pi - ans * ksm(inv(n), k) % 1000000007 + 1000000007) % 1000000007
       << endl;
  return 0;
}
