#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;


int main() {
	int n;
  	cin >> n;
  	vector<int> a(n);
  	for (int i = 0; i < n; i++) cin >> a[i];
  	sort(a.begin(), a.end());
  	unsigned long long ans = 1;
  	int x = n & 1, y = 1 - x;
    for (int i = 0; i < n; i++) {
       	if (a[i] != (i + x) / 2 * 2 + y) {
          	cout << 0 << endl;
          	return 0;
        }
    }
  	for (int i = 1; i < n; i += 2) {
        ans *= 2;
        ans %= 1000000007;
    }
    cout << ans << endl;
}