#include <bits/stdc++.h>
using namespace std;
inline long long read(void) {
  register long long x = 0;
  register short sgn = 1;
  register char c = getchar();
  while (c < 48 || 57 < c) {
    if (c == 45) sgn = 0;
    c = getchar();
  }
  while (47 < c && c < 58) {
    x = (x << 3) + (x << 1) + c - 48;
    c = getchar();
  }
  return sgn ? x : -x;
}
char wrunit[19];
short wrcnt;
inline void write(long long x) {
  wrcnt = 0;
  if (x == 0) {
    putchar('0');
    return;
  }
  if (x < 0) putchar('-'), x = -x;
  while (x != 0) {
    wrunit[++wrcnt] = x % 10 + 48;
    x /= 10;
  }
  for (; wrcnt > 0; --wrcnt) putchar(wrunit[wrcnt]);
}
long long n, k, ny;
long long srl[5005], prd;
long long frc[5005], cnt;
long long dp[5005][5005];
const long long mod = 1000000007;
inline long long ksm(long long a, long long i) {
  if (i == 1) return a;
  if (i == 0) return 1;
  if (i < 0) return 0;
  long long tmp = ksm(a, i >> 1);
  tmp = tmp * tmp % mod;
  if (i & 1) tmp = tmp * a % mod;
  return tmp;
}
signed main() {
  n = read(), k = read();
  prd = 1, dp[0][0] = 1, frc[0] = 1, ny = ksm(n, mod - 2);
  for (register long long i = 1; i <= n; ++i) srl[i] = read();
  for (register long long i = 1; i <= n; ++i) prd = prd * srl[i] % mod;
  for (register long long i = 1; i <= n; ++i)
    frc[i] = frc[i - 1] * (k - i + 1) % mod;
  for (register long long i = 1; i <= n; ++i)
    dp[i][0] = dp[i - 1][0] * srl[i] % mod;
  for (register long long i = 1; i <= n; ++i)
    for (register long long u = 1; u <= i; ++u)
      dp[i][u] = (dp[i - 1][u] * srl[i] - dp[i - 1][u - 1]) % mod;
  for (register long long i = 0; i <= n; ++i)
    (cnt += (dp[n][i] * ksm(n, k - i) % mod * frc[i] % mod)) %= mod;
  write(((prd - cnt * ksm(ny, k)) % mod + mod) % mod), puts("");
  return 0;
}
