#include <bits/stdc++.h>
#define EPS 1e-9
#define PI acos(-1)
using namespace std;
typedef long long ll;
const int mod = 1e9+7;
const int maxn = 1e5+100;
int a[maxn];

ll quick_pow(ll a,ll b)
{
    ll res = 1;
    while(b)
    {
        if(b&1) res = res*a%mod;
        a = (a*a)%mod;
        b >>= 1;
    }
    return res;
}

int main()
{
    ios::sync_with_stdio(false);
    int n;
    cin>>n;
    for(int i = 0; i < n; i++)
    {
        int num;
        cin>>num;
        a[num]++;
    }
    int ok = 1;
    if(n%2)//奇数
    {
        if(a[0] != 1) ok = 0;
        for(int i = 1; i < n ;i++)
        {
            if(i%2==1&&a[i]>0) ok = 0;
            if(i%2==0&&a[i]!=2) ok = 0;
        }
    }
    else
    {
        for(int i = 0; i < n ;i++)
        {
            if(i%2==0&&a[i]>0) ok = 0;
            if(i%2==1&&a[i]!=2) ok = 0;
        }
    }
    if(!ok)
    {
        cout<<"0"<<"\n";
    }
    else
    {
        cout<<quick_pow(2,n/2)<<"\n";
    }
}

