#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  int N;
  cin >> N;
  int div = 1e9 + 7;
  map<int, int> A;
  if (N % 2 == 0) {
    for (int i = 0; i < N; i++) {
      int tmp;
      cin >> tmp;
      tmp = (tmp - 1) / 2;
      A[tmp]++;
    }
  } else {
    for (int i = 0; i < N; i++) {
      int tmp;
      cin >> tmp;
      tmp = tmp / 2;
      A[tmp]++;
    }
  }
  if (N % 2 == 1 && A[0] != 1) {
    cout << 0 << endl;
    return 0;
  }
  int before = -1;
  int count = 0;
  for (auto a : A) {
    if (N % 2 == 1 && a.first == 0) {
      before = 0;
      continue;
    }
    if (a.second != 2 || a.first != before + 1) {
      cout << 0 << endl;
      return 0;
    }
    count++;
    before = a.first;
  }
  ll output = 1;
  for (int i = 0; i < count; i++) {
    output *= 2;
    output %= div;
  }
  cout << output << endl;
  return 0;
}
