#include <bits/stdc++.h>
using namespace std;
const int N = 5000, mod = 1000000007;
int add(int a, int b, int p = mod) { return a + b >= p ? a + b - p : a + b; }
int sub(int a, int b, int p = mod) { return a - b < 0 ? a - b + p : a - b; }
int mul(int a, int b, int p = mod) { return (long long)a * b % p; }
void sadd(int &a, int b, int p = mod) { a = add(a, b, p); }
void ssub(int &a, int b, int p = mod) { a = sub(a, b, p); }
void smul(int &a, int b, int p = mod) { a = mul(a, b, p); }
int Power(int a, int k, int p = mod) {
  int res = 1;
  for (; k; k >>= 1, smul(a, a, p))
    if (k & 1) smul(res, a, p);
  return res;
}
int Get_inv(int a, int p = mod) { return Power(a, p - 2, p); }
int n, m, a[N + 9], ml;
void into() {
  scanf("%d%d", &n, &m);
  ml = 1;
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &a[i]);
    smul(ml, a[i]);
  }
}
int dp[N + 9];
void Get_dp() {
  dp[0] = 1;
  for (int i = 1; i <= n; ++i) {
    for (int j = i; j >= 1; --j) dp[j] = sub(mul(a[i], dp[j]), dp[j - 1]);
    smul(dp[0], a[i]);
  }
}
int ans;
void Get_ans() {
  int dn = 1, pw = 1, inv = Get_inv(n);
  for (int i = 0; i <= n; ++i) {
    sadd(ans, mul(dp[i], mul(dn, pw)));
    smul(dn, sub(m, i));
    smul(pw, inv);
  }
}
void work() {
  Get_dp();
  Get_ans();
}
void outo() { printf("%d\n", sub(ml, ans)); }
int main() {
  into();
  work();
  outo();
  return 0;
}
