#include <bits/stdc++.h>
using namespace std;
const int mo = 1000000007;
const int maxn = 5006;
int a[maxn], n, m;
long long f[maxn];
inline long long mi(long long x, int y) {
  long long res = 1;
  while (y) {
    if (y & 1) res = res * x % mo;
    x = x * x % mo;
    y >>= 1;
  }
  return res;
}
inline long long cal(int k, int x) {
  long long res = 1;
  while (x) {
    res = res * k * 1LL % mo;
    k--;
    x--;
  }
  return res;
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  f[0] = 1;
  for (int i = 1; i <= n; i++) {
    for (int j = i; j >= 1; j--) f[j] = (1LL * a[i] * f[j] - f[j - 1]) % mo;
    f[0] = f[0] * 1LL * a[i] % mo;
  }
  long long cur = 1LL, ans = 0LL;
  for (int i = 0; i <= n; i++) {
    ans = (ans + 1LL * f[i] * cal(m, i) % mo * mi(cur, mo - 2)) % mo;
    cur = cur * 1LL * n % mo;
  }
  cur = 1LL;
  for (int i = 1; i <= n; i++) cur = cur * a[i] * 1LL % mo;
  printf("%lld", (cur + mo - ans) % mo);
  return 0;
}
