#include <iostream>
using namespace std;

typedef long long ll;
const int MAXN = 1e5 + 10, MOD = 1e9 + 7;
int n, cnt[MAXN];

ll powe(ll a, int b) {
	ll res = 1;
	do {
		if (b % 2)
			res *= a, res %= MOD;
		a *= a, a %= MOD;
	} while (b /= 2);
	return res;
}

int main() {
	cin >> n;
	for (int i = 0; i < n; i++) {
		int a;
		cin >> a;
		cnt[a]++;
	}
	int i;
	if (n % 2)
		i = 2;
	else
		i = 1;
	for (i; i < n; i += 2)
		if (cnt[i] != 2)
			return cout << 0, 0;
	cout << powe(2, n / 2);
}