#include <bits/stdc++.h>
#pragma Gcomcom target( \
    "sse,sse2,sse3,ssse3,sse4.1,sse4.2,avx,avx2,popcnt,tune=native")
using namespace std;
char BB[1 << 20], *SS = BB, *TT = BB;
inline int read() {
  int s = 0;
  char ch =
      (SS == TT && (TT = (SS = BB) + fread(BB, 1, 1 << 20, stdin), SS == TT)
           ? EOF
           : *SS++);
  while (!((ch >= '0') && (ch <= '9')))
    ch = (SS == TT && (TT = (SS = BB) + fread(BB, 1, 1 << 20, stdin), SS == TT)
              ? EOF
              : *SS++);
  while (((ch >= '0') && (ch <= '9')))
    s = (s << 3) + (s << 1) + (ch ^ 48),
    ch = (SS == TT && (TT = (SS = BB) + fread(BB, 1, 1 << 20, stdin), SS == TT)
              ? EOF
              : *SS++);
  return s;
}
const int maxn = 5005, mod = 1000000007;
int n, k, m, ans, a[maxn], f[maxn][maxn];
int ksm(int x, int y) {
  int s = 1;
  while (y) {
    if (y & 1) s = 1ll * s * x % mod;
    x = 1ll * x * x % mod;
    y >>= 1;
  }
  return s;
}
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  f[0][0] = 1;
  for (int i = 1; i <= n; i++) {
    f[i][0] = 1ll * f[i - 1][0] * a[i] % mod;
    for (int j = 1; j <= i; j++)
      f[i][j] = (1ll * f[i - 1][j] * a[i] - f[i - 1][j - 1]) % mod;
  }
  for (int i = 0; i <= min(n, k); i++) {
    int calc = 1;
    for (int j = k - i + 1; j <= k; j++) calc = 1ll * calc * j % mod;
    ans = (ans + 1ll * f[n][i] * ksm(n, k - i) % mod * calc) % mod;
  }
  ans = 1ll * ans * ksm(ksm(n, k), mod - 2) % mod;
  m = 1;
  for (int i = 1; i <= n; i++) m = 1ll * m * a[i] % mod;
  ans = (m - ans) % mod;
  if (ans < 0) ans += mod;
  printf("%d\n", ans);
  return 0;
}
