// Slower C++ solution:


#include <bits/stdc++.h>

using namespace std;



#define PB              push_back

#define MP              make_pair

#define xx              first

#define yy              second

#define abs(x)          ((x)<0?-(x):(x))

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

#define un(v)           (v).erase(unique((v).begin(),(v).end()),(v).end())

#define ITERATE(it, v)  for(__typeof((v).begin()) it = (v).begin(); it != (v).end(); it++)



typedef long long LL;

typedef pair <int, int> pii;



const LL oo = 2147383647;

const double pi = 2 * acos (0.0);

const double eps = 1e-9;



inline LL gcd(LL a, LL b) {

    a = abs(a); b = abs(b);

    while (b) { a = a % b; swap (a, b); } return a;

}



LL ext_gcd(LL A, LL B, LL *X, LL *Y) {

    LL x2, y2, x1, y1, x, y, r2, r1, q, r;

    x2 = 1; y2 = 0;

    x1 = 0; y1 = 1;

    for(r2 = A, r1 = B; r1 != 0; r2 = r1, r1 = r, x2 = x1, y2 = y1, x1 = x, y1 = y ) {

        q = r2 / r1;

        r = r2 % r1;

        x = x2 - (q * x1);

        y = y2 - (q * y1);

    }

    *X = x2; *Y = y2;

    return r2;

}



inline LL modInv(LL a, LL m) {

    LL x, y;

    ext_gcd(a, m, &x, &y);

    x %= m;

    if ( x < 0 ) x += m; //modInv is never negative

    return x;

}



inline LL power(LL a, LL p) {

    LL res = 1, x = a;

    while (p) {

        if (p & 1) res = (res * x);

        x = (x * x); p >>= 1;

    }

    return res;

}



inline LL bigmod(LL a, LL p, LL m) {

    LL res = 1 % m, x = a % m;

    while (p) {

        if (p & 1) res = (res * x) % m;

        x = (x * x) % m; p >>= 1;

    }

    return res;

}



///<-------------------------------------------------END OF TEMPLATE-------------------------------------------------->



const int N = 100001;

int A[N], cnt[N];



int main() {

    int n;

    scanf("%d", &n);

    memset(cnt, 0, sizeof cnt);

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

        int x;

        scanf("%d", &x);

        cnt[x]++;

    }

    if(cnt[0] > 1) {

        printf("0\n");

        exit(0);

    }

    else {

        int x = 0;

        for(int i = 0; i < N; i++) {

            if(cnt[i] == 0) continue;

            if(cnt[i] > 2) {

                printf("0\n");

                exit(0);

            }

            if(cnt[i] == 2) x++;

        }

        printf("%lld\n", bigmod(2, x, 1e9 + 7));

    }

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 1.4530759997650677x):
#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

    {

//        ll sum = 1;

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

//        {

//            sum = ((sum % mod) * 2)% mod;

//        }

//        cout<<sum<<"\n";

        cout<<quick_pow(2,n/2)<<"\n";

    }

}