#include <bits/stdc++.h>
using namespace std;
const int maxn = 5010, inf = 1e9, mod = 1e9 + 7;
const long long INF = 1e18;
long long Sum() { return 0; }
long long Mul() { return 1; }
template <typename... types>
long long Sum(long long x, types... y) {
  return ((x % mod) + Sum(y...)) % mod;
}
template <typename... types>
long long Mul(long long x, types... y) {
  return (x % mod) * Mul(y...) % mod;
}
int p[maxn];
int Pow(int a, int b) {
  int ans = 1;
  while (b) {
    if (b & 1) ans = Mul(ans, a);
    a = Mul(a, a);
    b >>= 1;
  }
  return ans;
}
int first(int a, int b) {
  int ans = 1;
  for (int i = a; i <= b; i++) ans = 1ll * ans * i % mod;
  return ans;
}
int C(int n, int k) {
  if (n < k || n < 0 || k < 0) return 0;
  return Mul(first(n - k + 1, n), Pow(first(1, k), mod - 2));
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n, k, prod = 1;
  cin >> n >> k;
  p[0] = 1;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    prod = Mul(prod, x);
    for (int j = i + 2; j > 0; j--) p[j] = Sum(Mul(x, p[j]), -p[j - 1]);
    p[0] = Mul(p[0], x);
  }
  int ans = 0;
  for (int i = 0; i <= min(k, n); i++)
    ans = Sum(ans, Mul(p[i], Pow(n, k - i), first(k - i + 1, k)));
  ans = Mul(ans, Pow(Pow(n, mod - 2), k));
  ans = Sum(prod, -ans);
  if (ans < 0) ans += mod;
  cout << ans << endl;
  return 0;
}
