#include <bits/stdc++.h>
using namespace std;
int a[5005], f[5005], g[5005], n, k;
int fac[5005], inv[5005], coef[5005];
inline int qpow(int a, int b) {
  int res = 1, tp = a;
  while (b) {
    if (b & 1) res = 1ll * res * tp % 1000000007;
    tp = 1ll * tp * tp % 1000000007;
    b >>= 1;
  }
  return res;
}
int main() {
  int i, j, ans = 0;
  fac[0] = 1;
  scanf("%d%d", &n, &k);
  for (i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    fac[i] = 1ll * fac[i - 1] * (k - i + 1) % 1000000007;
  }
  inv[n] = qpow(qpow(n, n), 1000000007 - 2);
  for (i = n - 1; i >= 1; i--) inv[i] = 1ll * inv[i + 1] * n % 1000000007;
  for (i = 1; i <= n; i++) coef[i] = 1ll * inv[i] * fac[i] % 1000000007;
  f[0] = a[1];
  f[1] = 1000000007 - 1;
  for (i = 2; i <= n; i++) {
    for (j = 0; j < i; j++) {
      if (f[j]) {
        g[j + 1] = 1000000007 - f[j];
      } else {
        g[j + 1] = 0;
      }
      g[j] += 1ll * a[i] * f[j] % 1000000007;
      if (g[j] >= 1000000007) g[j] -= 1000000007;
    }
    for (j = 0; j <= i; j++) f[j] = g[j];
    g[0] = 0;
  }
  for (i = 1; i <= n; i++) {
    ans += 1ll * coef[i] * f[i] % 1000000007;
    if (ans >= 1000000007) ans -= 1000000007;
  }
  if (ans) ans = 1000000007 - ans;
  printf("%d\n", ans);
  return 0;
}
