#include<iostream>
using namespace std;
typedef long long ll;

const ll maxn = 1e6 + 5;
const ll mod = 1e9 + 7;
int a[maxn]; 

int main()
{
	ll n, temp, flag = 1, ans = 1;
	for(ll i = 0; i < maxn; i++)
		a[i] = 0;
	cin >> n;
	for(ll i = 0; i < n; i++)
	{
		scanf("%lld", &temp);
		if(temp < maxn)
			a[temp]++;
	}
	if(n % 2 == 0)
	{
		for(ll i = 1; i < n; i += 2)
		{
			if(a[i] != 2)
			{
				flag = 0;
				break;
			}
			ans *= 2;
			ans %= mod;
		}
	}
	else
	{
		for(ll i = 0; i < n; i += 2)
		{
			if(i == 0 && a[i] != 1)
			{
				flag = 0;
				break;
			}
			if(i == 0 && a[i] == 1)
				continue;
				
			if(i > 0 && a[i] != 2)
			{
				flag = 0;
				break;
			}
			ans *= 2;
			ans %= mod;
		}
	}
	
	if(flag == 1)
		cout << ans << endl;
	else
		cout << "0" << endl;
		
		return 0;
	
} 