#include <bits/stdc++.h>
using namespace std;
int n, m, arr[5010], poly[2][5010] = {0}, prod_exp[5010];
long long pow_mod(int a, int b) {
  if (b == 0) return 1;
  long long r = pow_mod(a, b >> 1);
  r = ((((long long)(r)) * ((long long)(r))) % 1000000007);
  if (b & 1) r = ((((long long)(r)) * ((long long)(a))) % 1000000007);
  return r;
}
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 0; i < n; i++) scanf("%d", arr + i);
  poly[0][0] = 1;
  for (int i = 0; i < n; i++) {
    int z = i & 1;
    for (int j = 0; j <= i; j++) {
      poly[!z][j] =
          ((((long long)(poly[z][j])) * ((long long)(arr[i]))) % 1000000007);
    }
    for (int j = 1; j <= i + 1; j++) {
      poly[!z][j] -= poly[z][j - 1];
      if (poly[!z][j] < 0) poly[!z][j] += 1000000007;
    }
  }
  prod_exp[0] = pow_mod(n, n);
  int inv = pow_mod(n, 1000000007 - 2);
  int num = ((((long long)(prod_exp[0])) * ((long long)(poly[n & 1][0]))) %
             1000000007),
      denom = prod_exp[0];
  for (int i = 1; i <= n; i++) {
    prod_exp[i] =
        ((((long long)(prod_exp[i - 1])) *
          ((long long)(((((long long)(m - i + 1)) * ((long long)(inv))) %
                        1000000007)))) %
         1000000007);
    num = ((((long long)(num)) + ((long long)(((((long long)(prod_exp[i])) *
                                                ((long long)(poly[n & 1][i]))) %
                                               1000000007)))) %
           1000000007);
  }
  int prod = denom;
  for (int i = 0; i < n; i++)
    prod = ((((long long)(arr[i])) * ((long long)(prod))) % 1000000007);
  num = prod - num;
  if (num < 0) num += 1000000007;
  int ans =
      ((((long long)(num)) * ((long long)(pow_mod(denom, 1000000007 - 2)))) %
       1000000007);
  printf("%d\n", ans);
}
