#include <bits/stdc++.h>
struct MI {
 private:
  char bb[4096];
  FILE *f;
  char *bs, *be;
  char e;
  bool o, l;

 public:
  MI() : MI(stdin) {}
  MI(FILE *f) : f(f), bs(0), be(0), o(0), l(0) {}
  inline char get() {
    if (o) {
      o = 0;
      return e;
    }
    if (bs == be) be = (bs = bb) + fread(bb, 1, sizeof(bb), f);
    if (bs == be) {
      l = 1;
      return -1;
    };
    return *bs++;
  }
  inline void unget(char c) {
    o = 1;
    e = c;
  }
  template <class T>
  inline T read() {
    T r;
    *this > r;
    return r;
  }
  template <class T>
  inline MI &operator>(T &);
};
template <class T>
struct Q {
  const static bool U = T(-1) >= T(0);
  inline void operator()(MI &t, T &r) const {
    r = 0;
    char c;
    bool y = 0;
    if (U)
      for (;;) {
        c = t.get();
        if (c == -1) goto E;
        if (isdigit(c)) break;
      }
    else
      for (;;) {
        c = t.get();
        if (c == -1) goto E;
        if (c == '-') {
          c = t.get();
          if (isdigit(c)) {
            y = 1;
            break;
          };
        } else if (isdigit(c))
          break;
        ;
      };
    for (;;) {
      if (c == -1) goto E;
      if (isdigit(c))
        r = r * 10 + (c ^ 48);
      else
        break;
      c = t.get();
    }
    t.unget(c);
  E:;
    if (y) r = -r;
  }
};
template <>
struct Q<char> {};
template <class T>
inline MI &MI::operator>(T &t) {
  Q<T>()(*this, t);
  return *this;
}
template <class T>
inline std::ostream &operator<(std::ostream &out, const T &t) {
  return out << t;
}
using std::cout;
MI cin;
const int N = 101;
const int mod = 1000000007;
int n, cnt, K;
struct mat {
  int v[N][N];
} tr, ret, tmp;
inline int pro(int x) { return x >= mod ? x - mod : x; }
inline int per(int x) { return x < 0 ? x + mod : x; }
inline long long ksm(long long x, int p = mod - 2) {
  long long ret = 1;
  for (; p; p >>= 1, (x *= x) %= mod)
    if (p & 1) (ret *= x) %= mod;
  return ret;
}
inline void mult(const mat &a, const mat &b, mat &c) {
  const size_t clear_size(sizeof(int) * (cnt + 1));
  for (int i = 0; i <= cnt; ++i) memset(c.v[i], 0, clear_size);
  for (int i = 0; i <= cnt; ++i)
    for (int k = 0; k <= cnt; ++k)
      for (int j = 0; j <= cnt; ++j)
        c.v[i][j] = pro(c.v[i][j] + (long long)a.v[i][k] * b.v[k][j] % mod);
}
bool v[N];
int main() {
  cin > n > K;
  int pre = 0;
  for (int i = 1; i <= n; ++i)
    if (!(v[i] = (cin.read<int>()))) pre += !v[++cnt];
  if (cnt == n) return cout < "1\n", 0;
  const int mi(std::max(cnt * 2 - n, 0)),
      si(pro(ksm(((long long)n * (n - 1) % mod)) << 1));
  for (int i = mi; i <= cnt; ++i) {
    int tmp = 1;
    if (i != mi) {
      tr.v[i][i - 1] = (long long)i * (n - cnt * 2 + i) % mod * si % mod;
      tmp = per(tmp - tr.v[i][i - 1]);
    }
    if (i != cnt) {
      tr.v[i][i + 1] = (long long)(cnt - i) * (cnt - i) % mod * si % mod;
      tmp = per(tmp - tr.v[i][i + 1]);
    }
    tr.v[i][i] = tmp;
  }
  for (int i = 0; i <= cnt; ++i) ret.v[i][i] = 1;
  while (K) {
    if (K & 1) {
      mult(ret, tr, tmp);
      ret = tmp;
    }
    mult(tr, tr, tmp);
    tr = tmp;
    K >>= 1;
  }
  cout < ret.v[pre][cnt] < ('\n');
}
