#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
int n, k, a[105], sum, Q;
struct Mat {
  int s[105][105];
  Mat() { memset(s, 0, sizeof s); }
  Mat operator*(const Mat &B) {
    Mat ret;
    for (int k = 0; k <= sum; k++)
      for (int i = 0; i <= sum; i++)
        if (s[i][k])
          for (int j = 0; j <= sum; j++)
            if (B.s[k][j])
              ret.s[i][j] = (ret.s[i][j] + 1ll * s[i][k] * B.s[k][j]) % mod;
    return ret;
  }
} f, g;
inline int ksm(int a, int b) {
  int s = 1;
  for (; b; b >>= 1, a = 1ll * a * a % mod)
    if (b & 1) s = 1ll * s * a % mod;
  return s;
}
int main() {
  scanf("%d%d", &n, &k), Q = 1ll * (n - 1) * n / 2 % mod;
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]), sum += (a[i] == 0);
  int tmp = 0;
  for (int i = 1; i <= sum; i++) tmp += (a[i] == 0);
  f.s[0][tmp] = 1;
  for (int i = 0, x, y; i <= sum; i++) {
    x = y = 0;
    if (i) g.s[i][i - 1] = x = 1ll * i * (n - sum - (sum - i)) % mod;
    if (i < sum) g.s[i][i + 1] = y = 1ll * (sum - i) * (sum - i) % mod;
    g.s[i][i] = (Q - x - y + mod) % mod;
  }
  for (tmp = k; tmp; tmp >>= 1, g = g * g)
    if (tmp & 1) f = f * g;
  printf("%d\n", 1ll * f.s[0][sum] * ksm(ksm(Q, k), mod - 2) % mod);
}
