#include <bits/stdc++.h>
using namespace std;
const int MAXN = 107, MOD = 1e9 + 7;
int a[MAXN], o = 0, z, x, n, k, dp[MAXN][MAXN] = {};
int fir[MAXN], ans[MAXN];
void add(int &a, const int &b) {
  a += b;
  if (a >= MOD) a -= MOD;
}
struct matrix {
  int f[MAXN][MAXN] = {};
  matrix operator*(matrix &b) {
    matrix c;
    for (int i = 0; i <= z; ++i)
      for (int j = 0; j <= z; ++j) {
        c.f[i][j] = 0;
        for (int k = 0; k <= z; ++k)
          add(c.f[i][j], 1LL * this->f[i][k] * b.f[k][j] % MOD);
      }
    return c;
  }
} base;
matrix pw(matrix cs, int sm) {
  if (sm == 1) return cs;
  matrix hpw = pw(cs, sm >> 1);
  hpw = hpw * hpw;
  if (sm & 1) hpw = hpw * cs;
  return hpw;
}
int pw(int cs, int sm) {
  if (sm == 0) return 1;
  int hpw = pw(cs, sm >> 1);
  hpw = 1LL * hpw * hpw % MOD;
  if (sm & 1) hpw = 1LL * hpw * cs % MOD;
  return hpw;
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n >> k;
  for (int i = 1; i <= n; ++i) cin >> a[i], o += a[i];
  z = n - o, x = z;
  for (int i = 1; i <= z; ++i) x -= a[i];
  if (z == 0) return cout << 1, 0;
  fir[x] = 1;
  for (int i = 0; i <= z; ++i) {
    if (i > 0) {
      base.f[i - 1][i] = (z - i + 1) * (z - i + 1);
    }
    if (i < z) {
      base.f[i + 1][i] = (o - z + i + 1) * (i + 1);
    }
    base.f[i][i] += z * (z - 1) / 2;
    base.f[i][i] += (n - z) * (n - z - 1) / 2;
    base.f[i][i] += i * (z - i);
    base.f[i][i] += (z - i) * (o - z + i);
  }
  base = pw(base, k);
  for (int j = 0; j <= z; ++j) {
    ans[j] = 0;
    for (int k = 0; k <= z; ++k) add(ans[j], 1LL * fir[k] * base.f[k][j] % MOD);
  }
  int mau = pw(n * (n - 1) / 2, MOD - 2);
  cout << 1LL * ans[z] * pw(mau, k) % MOD;
  return 0;
}
