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

const int Mod = 1e9+7;

int solve(int n, vector<int> cnt){
  if (n%2 && !cnt[0]) return 0;
  int res = 1;
  for (int i = 1; i <= n-1; ++i) {
    if ((n%2== 1 && i%2 == 1) || (n%2 == 0 && i%2 == 0)) continue;
    res = res * 2 % Mod;
    if (cnt[i] != 2) return 0;
  }
  return res;
}

int main() {
  int n;
  cin >> n;
  vector<int> cnt(n, 0);
  rep(i, n) {
    int a;
    cin >> a;
    ++cnt[a];
  }
  cout << solve(n, cnt) << endl;
  return 0;
}