#include <bits/stdc++.h>
using namespace std;
long long int n, arr[105], hell = pow(10, 9) + 7;
long long int add(long long int a, long long int b) {
  a += b;
  if (a > hell) a -= hell;
  return a;
}
long long int pw(long long int x, long long int y) {
  long long int res = 1;
  x %= hell;
  while (y > 0) {
    if (y & 1) res = (res * x) % hell;
    y >>= 1;
    x = (x * x) % hell;
  }
  return res;
}
void mul(vector<vector<long long int>> &a, vector<vector<long long int>> &b) {
  long long int temp[n][n];
  for (long long int i = 0; i < n; i++)
    for (long long int j = 0; j < n; j++) {
      temp[i][j] = 0;
      for (long long int k = 0; k < n; k++)
        temp[i][j] = add(temp[i][j], (a[i][k] * b[k][j]) % hell);
    }
  for (long long int i = 0; i < n; i++)
    for (long long int j = 0; j < n; j++) a[i][j] = temp[i][j];
}
void exp(long long int y, vector<vector<long long int>> &res,
         vector<vector<long long int>> &mat) {
  while (y > 0) {
    if (y & 1) mul(res, mat);
    y >>= 1;
    mul(mat, mat);
  }
}
void solve() {
  long long int k, cnt = 0;
  cin >> n >> k;
  for (long long int i = 1; i <= n; i++) {
    cin >> arr[i];
    if (!arr[i]) cnt++;
  }
  long long int inv = pw(n * (n - 1) / 2, hell - 2);
  vector<vector<long long int>> res(n + 5, vector<long long int>(n + 5, 0));
  vector<vector<long long int>> mat(n + 5, vector<long long int>(n + 5, 0));
  for (long long int i = 0; i < n; i++) res[i][i] = 1;
  for (long long int i = 0; i <= min(cnt, n - cnt); i++) {
    if (i > 0) mat[i - 1][i] = (i * i * inv) % hell;
    mat[i][i] =
        (((cnt * (cnt - 1) + (n - cnt) * (n - cnt - 1)) / 2 + i * (n - 2 * i)) *
         inv) %
        hell;
    mat[i + 1][i] = ((cnt - i) * (n - cnt - i) * inv) % hell;
  }
  exp(k, res, mat);
  long long int tr = 0;
  for (long long int i = 1; i <= cnt; i++)
    if (arr[i]) tr++;
  cout << res[0][tr];
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int qc = 1;
  for (long long int i = 1; i <= qc; i++) solve();
}
