#include <bits/stdc++.h>
int n, k, f[5010], ans = 0;
int ksm(int x, int y) {
  int re = 1;
  for (; (y& 1 ? re = 1ll * re * x % 1000000007 : 0), y;
       y >>= 1, x = 1ll * x * x % 1000000007)
    ;
  return re;
}
inline int min(int x, int y) { return x < y ? x : y; }
int main() {
  scanf("%d %d", &n, &k);
  f[0] = 1;
  for (int i = 1, x; i <= n; i++) {
    scanf("%d", &x);
    for (int j = i; j > 0; j--)
      f[j] = (1ll * f[j] * x % 1000000007 - f[j - 1] + 1000000007) % 1000000007;
    f[0] = 1ll * f[0] * x % 1000000007;
  }
  for (int i = 0, fac = 1, n_ = 1; i <= min(n, k); i++) {
    ans = (ans + 1ll * f[i] * fac % 1000000007 * ksm(n_, 1000000007 - 2) %
                     1000000007) %
          1000000007;
    fac = 1ll * fac * (k - i) % 1000000007;
    n_ = 1ll * n_ * n % 1000000007;
  }
  printf("%d", (f[0] - ans + 1000000007) % 1000000007);
}
