#include <bits/stdc++.h>
const int p = 1e9 + 7;
const int maxn = 1e6 + 1;
template <class T>
inline void read(T &x) {
  T f = 1;
  x = 0;
  char s = getchar();
  while (s < '0' || s > '9') {
    if (s == '-') f = -1;
    s = getchar();
  }
  while (s >= '0' && s <= '9') {
    x = (x << 1) + (x << 3) + (s & 15);
    s = getchar();
  }
  x *= f;
}
inline long long ksm(long long a, long long b) {
  long long ans = 1;
  for (; b; b >>= 1, (a *= a) %= p)
    if (b & 1) (ans *= a) %= p;
  return ans;
}
long long fac[maxn], inv[maxn], nw, cnt1, cnt2, n, a[maxn], sbhfy,
    inv2 = ksm(2, p - 2), inpo[maxn];
inline void init() {
  fac[0] = 1;
  inv[0] = 1;
  for (long long i = 1; i <= 1e6; i++) fac[i] = (fac[i - 1] * i) % p;
  inv[1000000] = ksm(fac[1000000], p - 2);
  for (long long i = 999999; i >= 1; i--) inv[i] = (inv[i + 1] * (i + 1)) % p;
  inpo[0] = 1;
  for (long long i = 1; i <= 1000000; i++) inpo[i] = (inpo[i - 1] * inv2) % p;
}
inline long long C(long long a, long long b) {
  return ((fac[a] * inv[b]) % p) * inv[a - b] % p;
}
inline long long get1() {
  sbhfy = 1;
  long long tmp = 1;
  for (long long i = 2; i <= cnt1; i += 2) {
    nw = cnt1;
    long long cho = (i >> 1), end = (nw - (cho << 1) + 1);
    tmp = (fac[nw] * inv[end - 1]) % p;
    (tmp *= inpo[cho]) %= p;
    (tmp *= inv[cho]) %= p;
    (sbhfy += tmp) %= p;
  }
  return sbhfy;
}
inline void solve() {
  cnt1 = 0;
  cnt2 = 0;
  read(n);
  for (long long i = 1; i <= n; i++) read(a[i]);
  for (long long i = 1; i <= n; i++)
    if (a[i] & 1)
      cnt1++;
    else
      cnt2++;
  printf("%lld\n", (((fac[cnt2] * get1()) % p) * C(n, cnt1)) % p);
}
signed main() {
  init();
  solve();
}
