#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
inline void Add(int &a, int b) { a = a + b >= mod ? a + b - mod : a + b; }
inline int ksm(int a, int b) {
  int res = 1;
  for (; b; b >>= 1, a = 1ll * a * a % mod)
    if (b & 1) res = 1ll * res * a % mod;
  return res;
}
int N, k, n;
struct Matrix {
  int a[110][110];
  Matrix() { memset(a, 0, sizeof(a)); }
  inline void init() {
    for (int i = 0; i <= n; i++) a[i][i] = 1;
  }
  Matrix operator*(const Matrix &p) const {
    Matrix ans;
    for (int i = 0; i <= n; i++)
      for (int k = 0; k <= n; k++)
        for (int j = 0; j <= n; j++)
          Add(ans.a[i][j], 1ll * a[i][k] * p.a[k][j] % mod);
    return ans;
  }
  inline void print() {
    for (int i = 0; i <= n; i++) {
      for (int j = 0; j <= n; j++) printf("%d ", a[i][j]);
      putchar('\n');
    }
  }
};
inline Matrix ksm(Matrix a, int b) {
  Matrix res;
  res.init();
  for (; b; b >>= 1, a = a * a)
    if (b & 1) res = res * a;
  return res;
}
Matrix Base;
inline void trans(int x, int y, int k) { Add(Base.a[x][y], k); }
int v[110];
int main() {
  scanf("%d%d", &N, &k);
  for (int i = 1; i <= N; i++) scanf("%d", v + i), n += (v[i] == 0);
  if (n == 0) return puts("1"), 0;
  for (int i = 0; i <= n; i++) {
    int cnt1 = i, cnt0 = n - i;
    int rcnt1 = n - i, rcnt0 = N - n - rcnt1;
    if (rcnt0 < 0) continue;
    int allv = 1ll * N * (N - 1) / 2 % mod;
    trans(i, i,
          (mod + 1 -
           (1ll * cnt1 * rcnt0 + 1ll * cnt0 * rcnt1) % mod *
               ksm(allv, mod - 2) % mod) %
              mod);
    if (i) trans(i, i - 1, 1ll * cnt1 * rcnt0 % mod * ksm(allv, mod - 2) % mod);
    if (i < n)
      trans(i, i + 1, 1ll * cnt0 * rcnt1 % mod * ksm(allv, mod - 2) % mod);
  }
  Matrix t = ksm(Base, k);
  int cnt = 0;
  for (int i = 1; i <= n; i++) cnt += v[i];
  printf("%d\n", t.a[n - cnt][n]);
}
