#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll mod = 1000000007;

ll modpow(ll a, ll n)
{
  ll res=1;
  while (n>0) {
    if (n&1) res = res*a % mod;
    a = a*a % mod;
    n >>= 1;
  }
  return res;
}

int main()
{
  ll N;
  scanf("%lld",&N);
  vector<ll> A(N);
  for(int i=0; i<N; i++){
    scanf("%lld",&A[i]);
  }
  sort(A.begin(),A.end());
  for (int i=0; i<N; i++) {
    if (A[i]!=i+(i+(N+1)%2)%2) {
      cout << 0 << endl;
      return 0;
    }
  }
  cout << modpow(2, N/2) << endl;

  return 0;
}
