#include <bits/stdc++.h>
using namespace std;
template <std::uint32_t mod>
class modint {
 private:
  std::uint32_t n;

 public:
  modint() : n(0){};
  modint(std::uint64_t n_) : n(n_ % mod){};
  bool operator==(const modint& m) const { return n == m.n; }
  bool operator!=(const modint& m) const { return n != m.n; }
  std::uint32_t get() const { return n; }
  modint& operator+=(const modint& m) {
    n += m.n;
    n = (n < mod ? n : n - mod);
    return *this;
  }
  modint& operator-=(const modint& m) {
    n += mod - m.n;
    n = (n < mod ? n : n - mod);
    return *this;
  }
  modint& operator*=(const modint& m) {
    n = std::uint64_t(n) * m.n % mod;
    return *this;
  }
  modint operator+(const modint& m) const { return modint(*this) += m; }
  modint operator-(const modint& m) const { return modint(*this) -= m; }
  modint operator*(const modint& m) const { return modint(*this) *= m; }
  modint binpow(std::uint64_t b) const {
    modint ans = 1, m = modint(*this);
    while (b) {
      if (b & 1) ans *= m;
      m *= m;
      b >>= 1;
    }
    return ans;
  }
  modint inv() { return (*this).binpow(mod - 2); }
};
const int maxn = 110, mod = 1e9 + 7;
int arr[maxn];
modint<mod> mat[maxn][maxn], dp[maxn], tmp[maxn][maxn], ans[maxn][maxn];
int main() {
  int n, k, a, b, s;
  a = b = s = 0;
  cin >> n >> k;
  for (int i = 0; i < n; ++i) {
    scanf("%d", &arr[i]);
    if (arr[i])
      ++b;
    else
      ++a;
  }
  for (int i = 0; i < a; ++i)
    if (arr[i] == 0) ++s;
  for (int i = 0; i <= n; ++i) ans[i][i] = modint<mod>(1);
  for (int i = 0; i <= n; ++i) {
    for (int j = 0; j <= n; ++j) {
      if (j >= a - b && j <= a && i >= a - b && i <= a) {
        int a0 = j, a1 = a - a0, b1 = b - a1, b0 = b - b1;
        if (j - 1 == i)
          mat[i][j] = modint<mod>(a0 * b1);
        else if (j + 1 == i)
          mat[i][j] = modint<mod>(a1 * b0);
        else if (j == i)
          mat[i][j] = modint<mod>(n * (n - 1) / 2 - a0 * b1 - a1 * b0);
      }
    }
  }
  int ok = k;
  while (k) {
    if (k & 1) {
      for (int i = 0; i <= n; ++i) {
        for (int j = 0; j <= n; ++j) {
          tmp[i][j] = modint<mod>(0);
          for (int k = 0; k <= n; ++k) {
            tmp[i][j] += mat[i][k] * ans[k][j];
          }
        }
      }
      memcpy(ans, tmp, sizeof ans);
    }
    for (int i = 0; i <= n; ++i) {
      for (int j = 0; j <= n; ++j) {
        tmp[i][j] = modint<mod>(0);
        for (int k = 0; k <= n; ++k) {
          tmp[i][j] += mat[i][k] * mat[k][j];
        }
      }
    }
    memcpy(mat, tmp, sizeof(mat));
    k >>= 1;
  }
  long long num = ans[a][s].get(),
            deninv = modint<mod>(n * (n - 1) / 2).binpow(ok).inv().get();
  num = num * deninv % mod;
  if (num < 0) num += mod;
  cout << num;
  return 0;
}
