#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const long long N = 5000 + 5;
inline long long read() {
  long long x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
long long n, k;
long long f[N], tmp[N], a[N];
inline long long power(long long x, long long y) {
  long long ans = 1;
  for (; y; y >>= 1) {
    if (y & 1) ans = ans * x % mod;
    x = x * x % mod;
  }
  return ans;
}
signed main() {
  n = read();
  k = read();
  long long sum = 1;
  for (long long i = 1; i <= n; i++) a[i] = read(), sum = sum * a[i] % mod;
  f[0] = 1;
  for (long long i = 1; i <= n; i++) {
    memset(tmp, 0, sizeof(tmp));
    for (long long j = 0; j <= i - 1; j++) {
      tmp[j] = (tmp[j] + f[j] * a[i] % mod) % mod;
      tmp[j + 1] = (tmp[j + 1] - f[j] + mod) % mod;
    }
    memcpy(f, tmp, sizeof(f));
  }
  long long V = 1, ans = 0;
  for (long long i = 0; i <= min(n, k); i++, V = V * (k - i + 1) % mod)
    ans = (ans + f[i] * power(n, k - i) % mod * V % mod) % mod;
  long long val = power(n, k);
  val = power(val, mod - 2);
  ans = ans * val % mod;
  printf("%lld\n", (sum - ans + mod) % mod);
  return 0;
}
