#include <bits/stdc++.h>
using namespace std;

int N, F[100001];

int main(){
	int current = 0;
	long long result = 1;
	scanf("%d", &N);
	for(int i = 0; i < N; i++){
		int val;
		scanf("%d", &val);
		F[val]++;
	}
	if(N % 2 == 0) current++;
	while(current < N){
		if((current != 0 && F[current] == 2) || (current == 0 && F[current] == 1))
			result *= F[current], result %= 1000000007, current += 2;
		else{
			printf("0\n");
			return 0;
		}
	}
	printf("%lld\n", result);
	return 0;
}
