#include <bits/stdc++.h>
using namespace std;
const int N = 5010, mod = 1e9 + 7;
int a[N], dp[N][N];
long long power(long long a, long long b) {
  if (b == 0) return 1;
  long long res = power(a, b / 2);
  res *= res;
  res %= mod;
  if (b & 1) res *= a, res %= mod;
  return res;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, k;
  cin >> n >> k;
  for (int i = 0; i < n; i++) cin >> a[i];
  dp[0][0] = 1;
  for (int i = 1; i <= n; i++)
    for (int j = 0; j <= i; j++)
      if (j == 0)
        dp[i][j] = 1;
      else
        dp[i][j] =
            ((long long)dp[i - 1][j] + 1LL * dp[i - 1][j - 1] * a[i - 1]) % mod;
  long long ans = 0, foo = 1;
  for (int i = 1; i <= min(n, k); i++) {
    long long p = power(n, k - i);
    foo *= (k - i + 1);
    foo %= mod;
    p *= foo;
    p %= mod;
    if (i & 1) {
      ans += (1LL * dp[n][n - i] * p) % mod;
      ans %= mod;
    } else {
      ans -= (1LL * dp[n][n - i] * p) % mod;
      ans += mod;
      ans %= mod;
    }
  }
  cout << ans * power(power(n, k), mod - 2) % mod << endl;
}
