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

const ll maxn = 1e5 + 5;
const ll mod = 1e9 + 7;
ll n;
int flag = 1;
map<ll, ll>line;
map<ll, ll>::iterator iter;


ll fastPow(ll a, ll n)
{
	ll base = a % mod;
	ll ans = 1;
	while(n)
	{
		if(n & 1)
			ans *= base;
		base *= base;
		base %= mod;
		n >>= 1;
	} 
	return ans;
}

int main()
{ 
	int ans = 0;
	int check;
    cin >> n;
    check = n% 2;
    line.clear();
    for(int i = 1; i <= n; i++)
    {
        ll temp;
        cin >> temp;
        if(temp%2 == check)
        	flag = 0;
        line[temp]++;
    }
    
    if(line[0] > 1)
    {
    	flag = 0;
	}
       
    else 
    {
       	for(iter = line.begin(); iter != line.end(); iter++)
        {
            if(iter->second == 2)
         		ans++;
            
            else if(iter->second > 2)
            {
                flag = 0;
                break;
            }
        }
        ans %= mod;
        
    }
    if(flag == 1)
    	cout << fastPow(2, ans) % mod << endl;
    else
    	cout << "0" << endl;
    return 0;
}