// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;

typedef unsigned long long ll;

const int maxn=1e5+10;

const ll mm=1e9+7;

int sp[maxn],vis[maxn];

int main()

{

    int n;

    cin>>n;

    int flag=0;

    memset(vis,0,sizeof(vis));

    for(int i=1;i<=n;++i){

        cin>>sp[i];

        vis[sp[i]]++;

    }

    if(n%2==1)

    {

        for(int i=0;i<n;i+=2)

        {

            if(i==0)

            {

                if(vis[i]!=1)

                {

                    flag=1;

                    break;

                }

            }

            else

            {

                if(vis[i]!=2)

                {

                    flag=1;

                    break;

                }

            }

        }

        if(flag==1)

            cout<<0<<endl;

        else

        {

            ll res=1;

            for(int i=1;i<=(n-1)/2;++i)

            {

                res=((res%mm)*2)%mm;

            }

          //  ll ans=res%mm;

            cout<<res<<endl;

        }

    }

    else if(n%2==0)

    {

        int flag=0;

        for(int i=1;i<n;i+=2)

        {

            if(vis[i]!=2)

            {

                flag=1;

                break;

            }

        }

        if(flag==0)

        {

            ll res=1;

            for(int i=1;i<=n/2;++i)

            {

                res=((res%mm)*2)%mm;

            }

          //  ll ans=res%mm;

            cout<<res<<endl;

        }



        else cout<<0<<endl;

    }

    return 0;

}


// Optimized solution to the same problem (faster):
#include<algorithm>

#include<iostream>

#include<cstring>

#include<cstdio>

#include<string>

#include<vector>

#include<bitset>

#include<cmath>

#include<queue>

#include<stack>

#include<map>

#include<set>

using namespace std;

template<class T>inline void read(T &res)

{

    char c;T flag=1;

    while((c=getchar())<'0'|c>'9')if(c=='-')flag=-1;res=c-'0';

    while((c=getchar())>='0'&&c<='9')res=res*10+c-'0';res*=flag;

}

bitset<50>bit;

/*

bit.reset(); bit=n; bit.count();

*/

#define _for(i,a,b) for( int i=(a); i<(b); ++i)

#define rof(i,a,b)  for( int i=b-1;i>=a;i--)

#define rep(i,a,b)  for( int i=(a); i<=(b); ++i)

#define per(i,a,b)  for( int i=(b); i>=a; --i)

#define sd(n) scanf("%d",&n)

#define sdd(n,m) scanf("%d %d",&n,&m)

#define sddd(n,m,k) scanf("%d %d %d",&n,&m,&k)

#define pd(n)    printf("%d\n",n)

#define pd_(n)   printf("%d ",n)

#define pdd(n,m) printf("%d %d",n,m)

#define pddd(n,m,k) printf("%d %d %d",n,m,k)

#define pld(n) printf("%lld\n",n)

#define pldd(n,m) printf("%lld %lld\n",n,m)

#define sld(n)   scanf("%lld",&n)

#define sldd(n,m) scanf("%lld %lld",&n,&m)

#define slddd(n,m,k) scanf("%lld %lld %lld",&n,&m,&k)

#define sf(n)    scanf("%lf",&n)

#define sff(n,m) scanf("lf",&n,&m)

#define sfff(n,m,k) scanf("%lf %lf %lf",&n,&m,&k)

#define ss(str)  scanf("%s",str)

#define mm(a,n)  memset(a, n, sizeof(a))

#define debug(x) cout << #x << ": " << x << endl

#define pb push_back

#define fi first

#define se second

#define mod(x) ((x)%MOD)

typedef long long ll;

typedef pair<int,int> PII;

typedef unsigned long long ull;

typedef long double ld;

const int N=1e6+7;

const int MOD = 1e9 + 7;

//const double eps = 1e-9;

const double PI=atan(1.0)*4;

const int maxn=3e5+5;



ll pow(ll a,ll b,ll p)

{

    ll res=1%p;

    while(b)

    {

        if(b&1)

            res=(res*a)%p;

        a=(a*a)%p;

        b>>=1;

    }

    return res;

}

int a[N];

int b[N];



int main()

{

    int n;

    int x;

    sd(n);

    int k;

    for(int i=1;i<=n;i++)

    {

        sd(k);

        b[k]++;

    }

    int flag=0;

    int tot=0;

    if(n%2==1)

        x=2;

    else

        x=1;

    for(;x<n;x=x+2,tot++)

    {

        //debug(x);

        //debug(b[x]);



        if(b[x]!=2)

        {

            flag=1;

            break;

        }



    }

    //debug(flag);

    if(!flag)

        {

        cout << pow(2,tot,MOD) << endl;

        }

    else

        cout << 0 << endl;

    return 0;

}


// Fastest known solution for this problem: