#include <bits/stdc++.h>
#ifndef ONLINE_JUDGE
#define debug(x) cout << #x << ": " << x << endl
#else
#define debug(x)
#endif
using namespace std;
typedef long long ll;
const int MAXN=2e5+7;
const int INF=0x3f3f3f3f;
const int mod=1e9+7;

map<int,int>mp;

ll quick(ll x,ll n)  //快速幂 x^n
{
    ll res=1;
    while(n)
    {
        if(n&1) res=(res*x)%mod;
        x=(x*x)%mod;
        n>>=1;
    }
    return res;
}
int a[MAXN];
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
    cin>>n;
    for(int i=1,x;i<=n;++i)
    {
        cin>>x;
        a[x]++;
    }
    bool ok=1;
    if(n%2==0)
    {
        for(int i=1;i<=n;i+=2)
        {
            if(a[i]!=2)
            {
                ok=0;break;
            }
        }
        if(ok) cout<<quick(2,n/2)<<endl;
        else cout<<0<<endl;
    }
    else
    {
        if(a[0]!=1) ok=0;
        for(int i=2;i<=n;i+=2)
        {
            if(a[i]!=2)
            {
                ok=0;break;
            }
        }
        if(ok) cout<<quick(2,n/2)<<endl;
        else cout<<0<<endl;
    }
    return 0;
}
