#include <bits/stdc++.h>
using namespace std;
const int p = 1e9 + 7;
inline int ksm(int d, int k) {
  int ret = 1;
  while (k) {
    if (k & 1) ret = 1ll * ret * d % p;
    d = 1ll * d * d % p;
    k >>= 1;
  }
  return ret;
}
int n, a[200005], k, f[200005];
inline void upd(int &x, int y) { x += x + y >= p ? y - p : y; }
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  f[0] = 1;
  for (int i = 1; i <= n; i++) {
    for (int j = n; ~j; j--) {
      f[j] = 1ll * f[j] * a[i] % p;
      if (j) f[j] = f[j] >= f[j - 1] ? f[j] - f[j - 1] : f[j] - f[j - 1] + p;
    }
  }
  int ans = 0;
  for (int i = 0; i <= n && i <= k; i++) {
    int te = 1ll * f[i] * ksm(n, k - i) % p;
    for (int j = k; j > k - i; j--) te = 1ll * te * j % p;
    upd(ans, te);
  }
  int te = ksm(n, k);
  te = ksm(te, p - 2);
  ans = 1ll * ans * te % p;
  te = 1;
  for (int i = 1; i <= n; i++) te = 1ll * te * a[i] % p;
  printf("%d\n", (te - ans + p) % p);
}
