#include <bits/stdc++.h>

using namespace std;

const int MOD = 1e9 + 7;

int main(void)
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);

	map<int, int> mp;
	int n;
	cin >> n;
	for (int i = 0; i < n; i++) {
		int x;
		cin >> x;
		mp[x]++;
	}
	for (auto &p : mp) {
		if ((p.first == 0 && (p.second != 1 || n % 2 == 0))
		    || (p.first != 0 && p.second != 2)
		    || p.first % 2 == n % 2) {
			cout << "0\n";
			return 0;
		}
	}
	int res = 1;
	for (int i = 0; i < n / 2; i++) {
		res = (res * 2) % MOD;
	}
	cout << res << '\n';

	return 0;
}

