#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>

using namespace std;

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) FOR(i,0,n)

int mod = 1e9 + 7;

int main() {
	int n;
	int a[100000];
	cin >> n;
	REP(i, n) scanf("%d", &a[i]);
	
	int cnt[100000] = {};
	REP(i, n) cnt[a[i]-1]++;
	bool flag = false;
	REP(i, 100000) {
		if (n % 2 == 1 && i == n / 2) continue;
		if (cnt[i] != 0 && cnt[i] != 2) flag = true;
	}
	
	if (flag) puts("0");
	else {
		int ans = 1;
		REP(i, n / 2) ans = ans * 2 % mod;
		cout << ans << endl;
	}
	
	return 0;
}