#include <bits/stdc++.h>
using namespace std;
const int maxn = 5e3;
const int mod = 1e9 + 7;
int n, k;
int ans;
int a[maxn + 5];
int f[maxn * 2 + 5];
int ksm(long long ta, int tp) {
  int s = 1;
  for (; tp; ta = ta * ta % mod, tp >>= 1)
    if (tp & 1) s = ta * s % mod;
  return s;
}
void Mult(int *A, int *B, int *C, int len1, int len2) {
  static int Tmp[maxn * 2 + 5];
  for (int i = 0; i <= len1 + len2; i++) Tmp[i] = 0;
  for (int i = 0; i < len1; i++)
    for (int j = 0; j < len2; j++)
      Tmp[i + j] = (Tmp[i + j] + 1ll * A[i] * B[j] % mod) % mod;
  for (int i = 0; i < len1 + len2; i++) C[i] = Tmp[i];
}
void make_f(int l, int r, int *F) {
  if (l == r) {
    F[0] = a[l];
    F[1] = mod - 1;
    return;
  }
  int mid = (l + r) >> 1, len1 = mid - l + 2, len2 = r - l + 1;
  make_f(l, mid, F);
  make_f(mid + 1, r, F + len1);
  Mult(F, F + len1, F, len1, len2);
}
void init() {
  scanf("%d %d", &n, &k);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  make_f(1, n, f);
}
int main() {
  init();
  int invn = ksm(n, mod - 2);
  for (int i = 0, tn = 1, fack = 1; i <= min(n, k);
       tn = 1ll * tn * invn % mod, fack = 1ll * fack * (k - i) % mod, i++)
    ans = (ans + 1ll * f[i] * tn % mod * fack % mod) % mod;
  printf("%d\n", (f[0] - ans + mod) % mod);
  return 0;
}
