#include <bits/stdc++.h>
#define rep(i, n) for(int i=0; i<n; ++i)
using namespace std;
using ll = long long;

ll mod = 1000000007;
int main()
{
  int N;
  cin >> N;
  vector<int> A(N);
  rep(i, N) cin >> A[i];
  sort(A.begin(), A.end());

  int idx = 0;
  int n = 1;

  if(N%2 && A[0] == 0) {
    idx = 1;
    n = 2;
  }

  ll ans = 1;
  while(idx<N-1) {
    if(A[idx] == n && A[idx] == A[idx+1]) {
      n = n+2;
      ans = (ans*2)%mod;
    }
    else
    {
      cout << 0 << endl;
      return 0;
    }
    idx = idx+2;
  }
  cout << ans << endl;
  return 0;
}
