#include <bits/stdc++.h>
using namespace std;
long long f[20005], inv[20005], mi[20005], a[20005], dp[5005][5005], n, m, ans,
    tot;
long long jian(long long x) { return x < 0 ? x + 1000000007 : x; }
long long ksm(long long x, long long y) {
  long long ans = 1, t = x;
  while (y) {
    if (y & 1) ans = ans * t % 1000000007;
    t = t * t % 1000000007;
    y >>= 1;
  }
  return ans;
}
int main() {
  scanf("%lld%lld", &n, &m);
  tot = 1;
  for (long long i = 1; i <= n; i++)
    scanf("%lld", &a[i]), tot = tot * a[i] % 1000000007;
  f[0] = 1;
  for (long long i = 1; i <= n; i++) f[i] = f[i - 1] * i % 1000000007;
  inv[n] = ksm(f[n], 1000000007 - 2);
  for (long long i = n - 1; i >= 0; i--)
    inv[i] = inv[i + 1] * (i + 1) % 1000000007;
  dp[0][0] = 1;
  for (long long i = 1; i <= n; i++) {
    for (long long t = 0; t <= n; t++) {
      dp[i][t] = dp[i - 1][t] * a[i] % 1000000007;
    }
    for (long long t = 1; t <= n; t++) {
      dp[i][t] = jian(dp[i][t] - dp[i - 1][t - 1]);
    }
  }
  long long now = 1;
  for (long long i = 0; i <= min(n, m); i++) {
    ans = (ans + dp[n][i] * ksm(n, m - i) % 1000000007 * now) % 1000000007;
    now = now * (m - i) % 1000000007;
  }
  printf("%lld", jian(tot - ans * ksm(ksm(n, m), 1000000007 - 2) % 1000000007));
}
