#include <bits/stdc++.h>
using namespace std;
const int MAXN = 5005;
const long long MOD = 1e9 + 7;
template <typename T>
inline void read(T &AKNOI) {
  T x = 0, flag = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') flag = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  AKNOI = flag * x;
}
int n, K;
long long f[MAXN];
inline long long ksm(long long x, long long k) {
  long long ret = 1;
  while (k) {
    if (k & 1) ret = ret * x % MOD;
    x = x * x % MOD;
    k >>= 1;
  }
  return ret;
}
inline long long dnm(long long x, long long k) {
  long long ret = 1;
  while (k--) {
    ret = ret * (x--) % MOD;
  }
  return ret;
}
void solve() {
  read(n);
  read(K);
  f[0] = 1;
  for (int i = 1; i <= n; ++i) {
    long long a;
    read(a);
    for (int j = i; j >= 1; --j) {
      f[j] = (f[j] * a % MOD - f[j - 1] + MOD) % MOD;
    }
    f[0] = f[0] * a % MOD;
  }
  long long ans = 0;
  for (int i = min(n, K); i >= 0; --i) {
    ans = (ans + f[i] * ksm(n, K - i) % MOD * dnm(K, i)) % MOD;
  }
  ans = ans * ksm(ksm(n, K), MOD - 2) % MOD;
  ans = (f[0] - ans + MOD) % MOD;
  printf("%lld\n", ans);
}
int main() {
  solve();
  return 0;
}
