#include <bits/stdc++.h>
using namespace std;
template <typename S, typename T>
ostream& operator<<(ostream& out, pair<S, T> const& p) {
  out << '(' << p.first << ", " << p.second << ')';
  return out;
}
template <typename T>
ostream& operator<<(ostream& out, vector<T> const& v) {
  int l = v.size();
  for (int i = 0; i < l - 1; i++) out << v[i] << ' ';
  if (l > 0) out << v[l - 1];
  return out;
}
template <typename T>
void trace(const char* name, T&& arg1) {
  cout << name << " : " << arg1 << endl;
}
template <typename T, typename... Args>
void trace(const char* names, T&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cout.write(names, comma - names) << " : " << arg1 << " | ";
  trace(comma + 1, args...);
}
const int N = 5010;
const long long MOD = 1e9 + 7;
long long fast(long long a, long long b) {
  long long ret = 1;
  while (b) {
    if (b & 1) ret = ret * a % MOD;
    a = a * a % MOD;
    b >>= 1;
  }
  return ret;
}
long long a[N];
void add(long long& x, long long y) {
  x += y;
  if (x >= MOD) x -= MOD;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, k;
  cin >> n >> k;
  long long pro = 1;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    pro = pro * a[i] % MOD;
  }
  vector<long long> p(n + 1, 0);
  p[0] = a[1];
  p[1] = MOD - 1;
  for (int i = 2; i <= n; i++) {
    vector<long long> np(n + 1, 0);
    for (int j = 0; j < n; j++) {
      add(np[j], p[j] * a[i] % MOD);
      add(np[j + 1], p[j] * (MOD - 1) % MOD);
    }
    p = np;
  }
  long long num = 1;
  long long sum = 0;
  for (int i = 0; i <= min(n, k); i++) {
    add(sum, (p[i] * fast(n, k - i) % MOD) * num % MOD);
    num = num * (k - i) % MOD;
  }
  sum = sum * fast(fast(n, k), MOD - 2) % MOD;
  cout << (pro - sum + MOD) % MOD << endl;
  return 0;
}
