#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const double PI = acos(-1.0);
int m, n, x, t, y, a[105], k, l, r, z, all, b[105];
long long en;
char c;
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
long long qpow(long long a, long long n, long long p = (long long)1000000007) {
  long long r = 1 % p;
  for (a %= p; n; a = a * a % p, n >>= 1)
    if (n & 1) r = r * a % p;
  return r;
}
long long inv(long long x, long long p = (long long)1000000007) {
  return x <= 1 ? 1 : inv(p % x, p) * (p - p / x) % p;
}
void init() {}
struct Matix {
  long long a[105][105];
} q, ans;
Matix operator*(Matix aa, Matix bb) {
  Matix res = {};
  for (int i = 0; i <= m; i++)
    for (int j = 0; j <= m; j++) res.a[i][j] = 0;
  for (int i = 0; i <= m; i++)
    for (int j = 0; j <= m; j++)
      for (int k = 0; k <= m; k++)
        (res.a[i][j] += 1ll * aa.a[i][k] * bb.a[k][j] %
                        (long long)1000000007) %= (long long)1000000007;
  return res;
}
Matix operator^(Matix aa, int bb) {
  Matix res = {};
  for (int i = 0; i <= m; i++)
    for (int j = 0; j <= m; j++) res.a[i][j] = (i == j);
  for (; bb; aa = aa * aa, bb >>= 1)
    if (bb & 1) res = res * aa;
  return res;
}
void solve() {
  scanf("%d%d", &n, &k);
  int m1 = 0, m0 = 0;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    if (a[i]) {
      m1++;
    } else
      m0++;
  }
  m = m0;
  Matix res = {};
  for (int i = 0; i <= m0; i++)
    for (int j = 0; j <= m0; j++) res.a[i][j] = 0;
  for (int i = 0; i <= m0; i++) {
    if (i != 0) {
      res.a[i - 1][i] =
          1LL * (m0 - i + 1) * (m0 - i + 1) % (long long)1000000007;
    }
    res.a[i][i] = inv(2) * m1 * (m1 - 1) % (long long)1000000007 +
                  inv(2) * m0 * (m0 - 1) % (long long)1000000007 +
                  i * (m0 - i) % (long long)1000000007 +
                  (m0 - i) * (m1 - m0 + i) % (long long)1000000007;
    res.a[i][i] %= (long long)1000000007;
    if (i != m0) {
      res.a[i + 1][i] =
          1LL * (i + 1) * (m1 - m0 + i + 1) % (long long)1000000007;
    }
  }
  x = 0;
  for (int i = 1; i <= m0; i++) {
    if (!a[i]) x++;
  }
  ans = res ^ k;
  en = inv(qpow(n * (n - 1) / 2, k)) * ans.a[x][m0] % (long long)1000000007;
  printf("%lld\n", en);
}
int main() {
  int T;
  T = 1;
  for (int i = 1; i <= T; i++) {
    init();
    solve();
  }
  return 0;
}
