#include <bits/stdc++.h>
using namespace std;
long long mo = 1000000007;
long long read() {
  long long ans = 0, f = 1;
  char c = getchar();
  for (; c > '9' || c < '0'; c = getchar())
    if (c == '-') f = -1;
  for (; c <= '9' && c >= '0'; c = getchar()) ans = ans * 10 + c - '0';
  return f * ans;
}
long long n, c[1000029], a[1000029];
long long ans;
long long qpow(long long x, long long y) {
  long long an = 1;
  while (y > 1) {
    if (y % 2 == 1) {
      an *= x;
      an %= mo;
    }
    x *= x;
    x %= mo;
    y /= 2;
  }
  return (an * x) % mo;
}
long long k;
int main() {
  n = read();
  k = read();
  c[0] = 1;
  for (int i = 1; i <= n; i++) {
    a[i] = read();
    for (int j = i; j; j--) {
      c[j] = (c[j] * a[i] - c[j - 1] + mo) % mo;
    }
    c[0] = c[0] * a[i];
    c[0] %= mo;
  }
  long long inv = qpow(n, mo - 2), sum = 1;
  for (long long i = 0; i <= n; i++) {
    ans += c[i] * sum;
    ans += mo;
    ans %= mo;
    sum = (((sum * (k - i)) % mo) * inv + mo) % mo;
  }
  cout << (c[0] - ans + mo) % mo;
  return 0;
}
