#include <bits/stdc++.h>
using namespace std;
int power(int a, int b, int c, int ans = 1) {
  for (; b; b >>= 1, a = (long long)a * a % c)
    if (b & 1) ans = (long long)ans * a % c;
  return ans;
}
int a[5050], b[5050], c[5050];
const int mod = 1000000007;
int main() {
  int n, k;
  cin >> n >> k;
  for (int i = 1; i <= n; i++) scanf("%d", a + i);
  b[0] = 1;
  for (int i = 1; i <= n; i++) {
    for (int j = i; j >= 0; j--)
      b[j] = ((long long)b[j] * a[i] % mod + mod - (j ? b[j - 1] : 0)) % mod;
  }
  int t = min(k, n), d = 1;
  for (int i = t, kk = k; i >= 0; i--, kk--) {
    c[i] = (long long)d * power(n, kk, mod) % mod;
    d = (long long)d * kk % mod;
  }
  int ans = 0;
  for (int i = 0; i <= t; i++) ans = (ans + (long long)b[i] * c[t - i]) % mod;
  int mid = 1;
  for (int i = 1; i <= n; i++) mid = (long long)mid * a[i] % mod;
  ans = (long long)ans * power(n, mod - k - 1, mod) % mod;
  ans = (mid + mod - ans) % mod;
  cout << ans << endl;
  return 0;
}
