#include <bits/stdc++.h>
using namespace std;
const long long maxn = 1e6 + 10;
const long long Mod = 1e9 + 7;
long long n, k, a[maxn], ans, fac[maxn], inv[maxn], b[maxn], c[maxn];
inline long long power(long long a, long long b) {
  long long r = 1;
  while (b) {
    if (b & 1) r = r * a % Mod;
    a = a * a % Mod;
    b >>= 1;
  }
  return r;
}
inline void Mul(long long x, long long y) {
  for (long long i = n; i >= 1; --i) b[i] = (b[i] * x + y * b[i - 1]) % Mod;
  b[0] = x * b[0] % Mod;
}
inline long long Get(long long l, long long r) {
  long long ret = 1;
  for (long long i = (r), _end_ = (l); i <= _end_; ++i) ret = ret * i % Mod;
  return ret;
}
signed main() {
  scanf("%lld%lld", &n, &k);
  for (long long i = (1), _end_ = (n); i <= _end_; ++i) scanf("%lld", &a[i]);
  ans = 1;
  for (long long i = (1), _end_ = (n); i <= _end_; ++i) ans = ans * a[i] % Mod;
  b[0] = 1;
  for (long long i = (1), _end_ = (n); i <= _end_; ++i) Mul(a[i], -1);
  long long sum = 0;
  for (long long i = (0), _end_ = (min(n + 10, k)); i <= _end_; ++i)
    sum = (sum + (power(n, k - i) * Get(k, k - i + 1) % Mod) * b[i]) % Mod;
  sum = sum * power(power(n, k), Mod - 2) % Mod;
  ans = (ans - sum) % Mod;
  printf("%lld\n", (ans + Mod) % Mod);
  return 0;
}
