#include <bits/stdc++.h>
using namespace std;
const int maxN = 2e4 + 10, mod = 1e9 + 7;
int n, k;
int f[maxN + 1], g[maxN + 1], a[maxN + 1];
int pw[maxN + 1], ans[maxN + 1], res;
inline int ADD(int x, int y) { return x + y >= mod ? x + y - mod : x + y; }
inline int SUB(int x, int y) { return x - y < 0 ? x - y + mod : x - y; }
inline int mpow(int a, int x) {
  int ans = 1;
  while (x) {
    if (x & 1) ans = 1ll * ans * a % mod;
    a = 1ll * a * a % mod;
    x >>= 1;
  }
  return ans;
}
int main() {
  scanf("%d %d", &n, &k);
  res = 1;
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]), res = 1ll * res * a[i] % mod;
  pw[0] = 1;
  for (int i = 1; i <= n; i++) pw[i] = 1ll * pw[i - 1] * n % mod;
  f[0] = 1;
  for (int i = 1; i <= n; i++)
    for (int j = n; j >= 0; j--) {
      f[j] = 1ll * f[j] * a[i] % mod;
      if (j) f[j] = SUB(f[j], f[j - 1]);
    }
  int t = 1;
  for (int i = n, j = k; i >= 0 && j >= 0; i--, j--) {
    g[i] = 1ll * t * mpow(pw[n - i], mod - 2) % mod;
    t = 1ll * t * j % mod;
  }
  for (int i = 0; i <= n; i++)
    for (int j = 0; j <= n; j++)
      ans[i + j] = ADD(ans[i + j], 1ll * f[i] * g[j] % mod);
  printf("%d", SUB(res, ans[n]));
  return 0;
}
