#include <iostream>
#include <cstring>
#include <cstdlib>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <vector>
using namespace std;
const int maxn = 1e5+100;
const int MOD = 1e9+7;
const double Pi = 3.141592654;
typedef long long ll;
typedef unsigned long long ull;


int main()
{
    int n;
    cin >> n;
    int a[maxn];
    int vis[maxn];
    int st;
    ll ans = 1;
    memset(vis, 0, sizeof(vis));
    for(int i=1 ; i<=n ; ++i)
    {
        cin >> a[i];
        vis[a[i]] ++;
    }
    if(!(n%2))//even
    {
        if(vis[0])
        {
            cout << 0 << endl;
            return 0;
        }
        for(int i=1 ; i<=n ; i+=2)
        {
            ans = (ans%MOD)*2%MOD;
            if(vis[i] != 2)
        {
            cout << 0 << endl;
            return 0;
        }
        }
    }
    else
    {
        if(vis[0] != 1)
        {
            cout << 0 << endl;
            return 0;
        }
        for(int i=2 ; i<=n ; i+=2)
        {
            ans = (ans%MOD)*2%MOD;
            if(vis[i] != 2)
        {
            cout << 0 << endl;
            return 0;
        }
        }
    }
    cout << ans << endl;

}

//9(4(7(1)(2))(3(6)(8)))(5(10)(11(12)))
