#include <bits/stdc++.h>
using namespace std;
const int N = 5005, mo = 1e9 + 7;
int n, K, m, ans, a[N], f[N][N];
int quick(int x, int y) {
  if (!y) return 1;
  int s = quick(x, y >> 1);
  s = (long long)s * s % mo;
  if (y & 1) s = (long long)s * x % mo;
  return s;
}
int main() {
  scanf("%d%d", &n, &K);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  f[0][0] = 1;
  for (int i = 1; i <= n; i++) {
    f[i][0] = (long long)f[i - 1][0] * a[i] % mo;
    for (int j = 1; j <= i; j++)
      f[i][j] = ((long long)f[i - 1][j] * a[i] - f[i - 1][j - 1]) % mo;
  }
  for (int i = 0; i <= min(n, K); i++) {
    int calc = 1;
    for (int j = K - i + 1; j <= K; j++) calc = (long long)calc * j % mo;
    ans = (ans + (long long)f[n][i] * quick(n, K - i) % mo * calc) % mo;
  }
  ans = (long long)ans * quick(quick(n, K), mo - 2) % mo;
  m = 1;
  for (int i = 1; i <= n; i++) m = (long long)m * a[i] % mo;
  ans = (m - ans) % mo;
  if (ans < 0) ans += mo;
  printf("%d\n", ans);
  return 0;
}
