#include <bits/stdc++.h>
using namespace std;
long long a, b, l[100001], an[100001], u[100001], mod = 1000000007;
long long pow_(long long qq, long long ww) {
  long long ee = 1;
  while (ww) {
    if (ww & 1) {
      ee *= qq;
      ee %= mod;
    }
    qq *= qq;
    qq %= mod;
    ww >>= 1;
  }
  return ee % mod;
}
int main() {
  scanf("%lld%lld", &a, &b);
  for (int i = 1; i <= a; i++) {
    scanf("%lld", &l[i]);
  }
  an[0] = l[1];
  an[1] = -1;
  long long hh = 1;
  for (int i = 1; i < a; i++) {
    for (int j = 0; j <= hh; j++) {
      u[j] = an[j];
      an[j] = 0;
    }
    for (int j = 0; j <= hh; j++) {
      an[j] += u[j] * l[i + 1];
      an[j + 1] -= u[j];
      an[j] %= mod;
      an[j + 1] %= mod;
    }
    hh++;
  }
  long long gg = 1, tt = 1, kk = 0;
  for (int i = 0; i <= min(a, b); i++) {
    kk += tt * pow_(gg, mod - 2) % mod * an[i] % mod;
    kk %= mod;
    tt *= (b - i);
    tt %= mod;
    gg *= a;
    gg %= mod;
  }
  printf("%lld", ((an[0] - kk) % mod + mod) % mod);
  return 0;
}
