#include <bits/stdc++.h>
using namespace std;
const int p = 1e9 + 7;
const int maxn = 5050;
int n, k, a[maxn], c[maxn * maxn], fact[maxn];
int poww(int a, int b) {
  int ans = 1;
  while (b) {
    if (b & 1) ans = 1ll * ans * a % p;
    b >>= 1;
    a = 1ll * a * a % p;
  }
  return ans;
}
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; ++i) scanf("%d", &a[i]);
  c[0] = 1;
  int tot = 0;
  for (int i = 1; i <= n; ++i) {
    for (int j = tot + 1; j >= 1; --j) c[j] = (p - c[j - 1]) % p;
    tot++;
    c[0] = 0;
    for (int j = 0; j <= tot; ++j)
      c[j] = ((c[j] - 1ll * c[j + 1] * a[i]) % p + p) % p;
  }
  int ans = 0, ni = 1, cnt = 1;
  fact[0] = 1;
  for (int i = 1; i <= n; ++i) fact[i] = 1ll * fact[i - 1] * (k - i + 1) % p;
  for (int i = 0; i <= min(n, k); ++i) {
    ans = (ans + 1ll * c[i] * fact[i] % p * poww(ni, p - 2) % p) % p;
    ni = 1ll * ni * n % p;
  }
  ans = p - ans;
  for (int i = 1; i <= n; ++i) cnt = 1ll * cnt * a[i] % p;
  cout << (ans + cnt) % p;
}
