#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
inline int ksm(int a, int b) {
  int res = 1;
  for (; b; b >>= 1, a = 1ll * a * a % mod)
    if (b & 1) res = 1ll * res * a % mod;
  return res;
}
int n, k, a[5010];
int main() {
  scanf("%d%d", &n, &k);
  int ans = 1;
  for (int i = 1; i <= n; i++) scanf("%d", a + i);
  a[0] = 1;
  for (int i = 1; i <= n; i++) {
    ans = 1ll * ans * a[i] % mod;
    int x = a[i];
    a[i] = 0;
    for (int j = i - 1; j >= 0; j--)
      a[j + 1] = (a[j + 1] - a[j] + mod) % mod, a[j] = 1ll * a[j] * x % mod;
  }
  int now = 1, mul = 1, inv = ksm(n, mod - 2);
  for (int i = 0; i <= n; i++) {
    ans = (ans - 1ll * now * mul % mod * a[i] % mod + mod) % mod;
    now = 1ll * now * (k - i) % mod;
    mul = 1ll * mul * inv % mod;
  }
  printf("%d", ans);
}
