#include <bits/stdc++.h>
using namespace std;
const int MAXSIZE = 10000020;
int bufpos;
char buf[MAXSIZE];
void init() {
  buf[fread(buf, 1, MAXSIZE, stdin)] = '\0';
  bufpos = 0;
}
int readint() {
  int val = 0;
  for (; !isdigit(buf[bufpos]); bufpos++)
    ;
  for (; isdigit(buf[bufpos]); bufpos++) val = val * 10 + buf[bufpos] - '0';
  return val;
}
char readchar() {
  for (; isspace(buf[bufpos]); bufpos++)
    ;
  return buf[bufpos++];
}
int readstr(char* s) {
  int cur = 0;
  for (; isspace(buf[bufpos]); bufpos++)
    ;
  for (; !isspace(buf[bufpos]); bufpos++) s[cur++] = buf[bufpos];
  s[cur] = '\0';
  return cur;
}
const int mod = 1000000007;
long long a[5003];
long long power(long long x, long long y) {
  long long ans = 1;
  while (y) {
    if (y & 1) ans = ans * x % mod;
    x = x * x % mod;
    y >>= 1;
  }
  return ans;
}
int main() {
  init();
  int n = readint();
  long long k = readint(), ans = 1;
  a[0] = 1;
  for (int i = 1; i <= n; i++) {
    long long x = readint();
    ans = ans * x % mod;
    for (int j = i - 1; j >= 0; j--) {
      a[j + 1] = (a[j + 1] - a[j]) % mod;
      a[j] = a[j] * x % mod;
    }
  }
  long long now = 1, pw = 1;
  long long inv = power(n, mod - 2);
  for (int i = 0; i <= n; i++) {
    ans = (ans - now * pw % mod * a[i]) % mod;
    now = now * (k - i) % mod;
    pw = pw * inv % mod;
  }
  printf("%lld", (ans % mod + mod) % mod);
}
