#include <bits/stdc++.h>
using namespace std;
namespace red {
inline long long read() {
  long long x = 0;
  char ch, f = 1;
  for (ch = getchar(); (ch < '0' || ch > '9') && ch != '-'; ch = getchar())
    ;
  if (ch == '-') f = 0, ch = getchar();
  while (ch >= '0' && ch <= '9') {
    x = (x << 1) + (x << 3) + ch - '0';
    ch = getchar();
  }
  return f ? x : -x;
}
const long long N = 4e5 + 10, p = 1e9 + 7;
long long n, k, ans, len;
long long fac[N], inv[N];
long long a[N];
long long f[N], g[N], h[N];
inline void add(long long &x, long long y) {
  x += y;
  if (x >= p) x -= p;
  if (x < 0) x += p;
}
inline long long fast(long long x, long long k) {
  long long ret = 1;
  while (k) {
    if (k & 1) ret = ret * x % p;
    x = x * x % p;
    k >>= 1;
  }
  return ret;
}
inline void main() {
  n = read(), k = read();
  ans = 1;
  f[0] = 1;
  len = 0;
  for (long long i = 1; i <= n; ++i) {
    a[i] = read();
    ans = ans * a[i] % p;
    g[0] = a[i], g[1] = -1;
    for (long long j = 0; j < i; ++j) {
      for (long long k = 0; k <= 1; ++k) {
        add(h[j + k], f[j] * g[k] % p);
      }
    }
    for (long long j = 0; j <= i; ++j) f[j] = h[j], h[j] = 0;
  }
  for (long long tmp = 1, i = 0; i <= min(n, k); ++i, tmp = tmp * n % p) {
    long long ret = f[i];
    for (long long j = k, d = i; d; --d, --j) ret = ret * j % p;
    ret = ret * fast(tmp, p - 2);
    add(ans, -ret % p);
  }
  printf("%lld\n", ans);
}
}  // namespace red
signed main() {
  red::main();
  return 0;
}
