#include <bits/stdc++.h>
const int N = 210, MO = 1e9 + 7;
int n, K, A[N], fac[N], inv[N], invn[N], a[N][N], ans[N][N], c[N][N], lm;
inline void Add(int &a, const int &b) {
  a += b;
  if (a >= MO)
    a -= MO;
  else if (a < 0)
    a += MO;
  return;
}
inline int qpow(int a, int b) {
  int ans = 1;
  while (b) {
    if (b & 1) {
      ans = 1ll * ans * a % MO;
    }
    a = 1ll * a * a % MO;
    b = b >> 1;
  }
  return ans;
}
inline int Inv(int x) { return qpow(x, MO - 2); }
inline int iC(int n, int m) {
  if (n < 0 || m < 0 || n < m) return 0;
  return 1ll * invn[n] * fac[m] % MO * fac[n - m] % MO;
}
inline void mulself() {
  memset(c, 0, sizeof(c));
  for (int k = 0; k <= lm; k++) {
    for (int i = 0; i <= lm; i++) {
      if (!a[i][k]) continue;
      for (int j = 0; j <= lm; j++) {
        Add(c[i][j], 1ll * a[i][k] * a[k][j] % MO);
      }
    }
  }
  memcpy(a, c, sizeof(a));
  return;
}
inline void mul() {
  memset(c, 0, sizeof(c));
  for (int k = 0; k <= lm; k++) {
    for (int i = 0; i <= lm; i++) {
      if (!a[i][k]) continue;
      for (int j = 0; j <= lm; j++) {
        Add(c[i][j], 1ll * a[i][k] * ans[k][j] % MO);
      }
    }
  }
  memcpy(ans, c, sizeof(c));
  return;
}
int main() {
  scanf("%d%d", &n, &K);
  int cnt = 0, aim = 0;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &A[i]);
    cnt += A[i];
  }
  for (int i = 1; i + cnt <= n; i++) {
    aim += A[i];
  }
  int P = Inv(n * (n - 1) / 2);
  fac[0] = inv[0] = invn[0] = 1;
  fac[1] = inv[1] = invn[1] = 1;
  for (int i = 2; i <= n; i++) {
    fac[i] = 1ll * i * fac[i - 1] % MO;
    inv[i] = 1ll * inv[MO % i] * (MO - MO / i) % MO;
    invn[i] = 1ll * invn[i - 1] * inv[i] % MO;
  }
  lm = n - cnt;
  for (int j = 0; j <= n - cnt; j++) {
    int t1 = 1ll * (cnt - j) * (n - cnt - j) % MO * P % MO;
    int t2 = 1ll * j * j * P % MO;
    Add(a[j][j], (1 - t1 + MO - t2 + MO) % MO);
    Add(a[j][j + 1], t1);
    Add(a[j][j - 1], t2);
  }
  for (int i = 0; i <= lm; i++) {
    ans[i][i] = 1;
  }
  while (K) {
    if (K & 1) {
      mul();
    }
    mulself();
    K >>= 1;
  }
  int Ans = 1ll * ans[0][aim] * iC(n - cnt, aim) % MO * iC(cnt, aim) % MO;
  printf("%d\n", (Ans + MO) % MO);
  return 0;
}
