#include <bits/stdc++.h>
using namespace std;
const int Mod = 1e9 + 7;
int add(int a, int b) { return a + b >= Mod ? a + b - Mod : a + b; }
int dec(int a, int b) { return a - b < 0 ? a - b + Mod : a - b; }
int mul(int a, int b) { return 1ll * a * b % Mod; }
int ksm(int a, int b) {
  int as = 1;
  for (; b; b >>= 1, a = mul(a, a))
    if (b & 1) as = mul(as, a);
  return as;
}
void Add(int &a, int b) { a = add(a, b); }
void Mul(int &a, int b) { a = mul(a, b); }
void Dec(int &a, int b) { a = dec(a, b); }
const int N = 5e3 + 50;
int n, k, f[N], a[N];
int main() {
  scanf("%d%d", &n, &k);
  f[0] = 1;
  int S = 1;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    Mul(S, a[i]);
    for (int j = i; j >= 0; j--) f[j] = dec(mul(f[j], a[i]), f[j - 1]);
  }
  int in = ksm(n, Mod - 2), as = 0;
  for (int i = 0, coe = 1; i <= min(n, k); i++) {
    Add(as, mul(coe, f[i]));
    Mul(coe, mul(in, k - i));
  }
  cout << dec(S, as);
  return 0;
}
