#include <bits/stdc++.h>
using namespace std;
const int maxn = 5e3 + 7, inf = 0x3f3f3f3f, mod = 1e9 + 7;
long long f[maxn][maxn], a[maxn];
long long quick(long long x, long long n) {
  long long res = 1;
  while (n) {
    if (n & 1) res = res * x % mod;
    x = x * x % mod;
    n >>= 1;
  }
  return res;
}
long long calc(int st, int ed) {
  long long res = 1;
  for (int i = st; i <= ed; ++i) res = res * i % mod;
  return res;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, k;
  cin >> n >> k;
  long long mul = 1;
  for (int i = 1; i <= n; ++i) cin >> a[i], mul = mul * a[i] % mod;
  f[0][0] = 1;
  for (int i = 1; i <= n; ++i) {
    for (int j = 0; j <= i; ++j) {
      f[i][j] =
          (f[i - 1][j] * a[i] % mod + (j ? mod - f[i - 1][j - 1] : 0)) % mod;
    }
  }
  long long ans = 0;
  for (int i = 0; i <= n && i <= k; ++i)
    ans = (ans + f[n][i] * quick(n, k - i) % mod * calc(k - i + 1, k) % mod) %
          mod;
  cout << (mul - ans * quick(quick(n, k), mod - 2) % mod + mod) % mod << '\n';
  return 0;
}
