#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
int n, k, a[5005];
long long c[5005], ans = 1, K[5005], N[5005], b[5005];
long long ksm(long long x, int y) {
  long long ret = 1;
  x %= mod;
  while (y) {
    if (y & 1) ret = ret * x % mod;
    x = x * x % mod;
    y >>= 1;
  }
  return ret;
}
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &a[i]);
    ans = ans * a[i] % mod;
  }
  c[0] = 1;
  K[0] = 1;
  N[0] = 1;
  for (int i = 1; i <= n; ++i) {
    for (int j = 0; j < i; ++j) {
      b[j] = c[j];
      c[j] = c[j] * a[i] % mod;
    }
    for (int j = i; j >= 1; --j) {
      c[j] = ((c[j] - b[j - 1]) % mod + mod) % mod;
    }
    if (k - i + 1 > 0)
      K[i] = K[i - 1] * (k - i + 1) % mod;
    else
      K[i] = 0;
    N[i] = N[i - 1] * n % mod;
  }
  for (int i = 0; i <= n; ++i) {
    ans = ((ans - c[i] * K[i] % mod * ksm(N[i], mod - 2)) % mod + mod) % mod;
  }
  printf("%lld\n", ans);
  return 0;
}
