#include <bits/stdc++.h>
using namespace std;
int read() {
  int s = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') s = s * 10 + ch - '0', ch = getchar();
  return s * f;
}
void upd(int &x, int y) { x += x + y >= 1000000007 ? y - 1000000007 : y; }
int a[5010], top, n, k;
int ksm(int bs, int mi) {
  int ans = 1;
  while (mi) {
    if (mi & 1) ans = 1ll * ans * bs % 1000000007;
    bs = 1ll * bs * bs % 1000000007;
    mi >>= 1;
  }
  return ans;
}
int fac(int x) {
  int c = 1;
  for (int i = k; i > k - x; i--) c = 1ll * c * i % 1000000007;
  return c;
}
int main() {
  n = read(), k = read();
  a[0] = top = 1;
  int qwq = 1;
  for (int i = 1; i <= n; i++) {
    int v = read();
    qwq = 1ll * qwq * v % 1000000007;
    for (int i = top - 1; ~i; i--)
      upd(a[i + 1], 1000000007 - a[i]), a[i] = 1ll * a[i] * v % 1000000007;
    top++;
  }
  int ans = 0, c = 1;
  for (int i = 0; i < min(k + 1, top); i++)
    upd(ans, 1ll * ksm(n, k - i) * a[i] % 1000000007 * fac(i) % 1000000007);
  printf("%d\n", (qwq + 1000000007 -
                  1ll * ans * ksm(ksm(n, k), 1000000007 - 2) % 1000000007) %
                     1000000007);
  return 0;
}
