#include <bits/stdc++.h>
using namespace std;
const long long N = 5100, P = 1e9 + 7;
long long n, k, f[N], ans;
long long power(long long x, long long b) {
  long long ans = 1;
  while (b) {
    if (b & 1) ans = ans * x % P;
    x = x * x % P;
    b >>= 1;
  }
  return ans;
}
signed main() {
  scanf("%lld%lld", &n, &k);
  f[0] = 1;
  for (long long i = 1; i <= n; i++) {
    long long x;
    scanf("%lld", &x);
    for (long long j = i; j >= 1; j--) f[j] = (f[j] * x - f[j - 1] + P) % P;
    f[0] = f[0] * x % P;
  }
  long long tt = 1, inv = power(n, P - 2);
  for (long long i = 0; i <= n; i++) {
    ans = (ans + f[i] * tt % P) % P;
    tt = tt * inv % P * (k - i) % P;
  }
  printf("%lld\n", (f[0] - ans + P) % P);
  return 0;
}
