#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int modinv2 = 5e8 + 4;
const int G = 3;
const int N = 5010;
int fac[N], ifac[N], inv[N], pw[N];
int a[N], b[N], c[N], n, k;
void init() {
  fac[0] = ifac[0] = inv[0] = 1;
  fac[1] = ifac[1] = inv[1] = 1;
  for (int i = 2; i < N; i++) {
    fac[i] = fac[i - 1] * (long long)i % mod;
    inv[i] = (mod - mod / i) * (long long)inv[mod % i] % mod;
    ifac[i] = ifac[i - 1] * (long long)inv[i] % mod;
  }
}
int main() {
  long long ans = 1;
  init();
  pw[0] = 1;
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    ans = ans * a[i] % mod;
    pw[i] = (long long)pw[i - 1] * n % mod;
  }
  c[0] = 1;
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j < i; j++) b[j] = (long long)c[j] * a[i] % mod;
    for (int j = 0; j < i; j++) b[j + 1] = (b[j + 1] - c[j] + mod) % mod;
    memcpy(c, b, sizeof(c));
  }
  for (int i = 0, t = 1, T = 1; i <= n; i++) {
    c[i] = (long long)c[i] * t % mod * T % mod;
    t = (long long)t * inv[n] % mod;
    T = (long long)T * (k - i) % mod;
  }
  for (int i = 0; i <= n; i++) ans = (ans - c[i] + mod) % mod;
  printf("%lld\n", (ans + mod) % mod);
  return 0;
}
