#include <bits/stdc++.h>
using namespace std;
const long long maxn = 5010, mo = 1000000007;
long long c[maxn] = {1}, d[maxn], a[maxn];
long long k, l, t, n, m, ni, num, ans;
inline long long read() {
  long long x = 0, f = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9')
    x = (x << 3) + (x << 1) + (c ^ 48), c = getchar();
  return x * f;
}
long long ksm(long long x, long long y) {
  if (!y) return 1;
  long long t = ksm(x, y / 2);
  t = t * t % mo;
  if (y % 2) t = t * x % mo;
  return t;
}
signed main() {
  n = read(), k = read();
  for (register long long i = 1; i <= n; ++i) {
    a[i] = read();
    for (register long long j = 0; j <= n; ++j) d[j] = 0;
    for (register long long j = 0; j < n; ++j) {
      (d[j] += c[j] * a[i] % mo) %= mo;
      (d[j + 1] -= c[j]) %= mo;
    }
    for (register long long j = 0; j <= n; ++j) c[j] = d[j];
  }
  ni = ksm(n, mo - 2);
  num = 1;
  for (register long long i = 0; i <= n; ++i) {
    (ans += c[i] * num % mo) %= mo;
    num = num * ni % mo * (k - i) % mo;
  }
  ans = (c[0] - ans) % mo, (ans += mo) %= mo;
  printf("%lld\n", ans);
}
