#include<bits/stdc++.h>
using namespace std;

int main(void){
    int a, b[100010], n, ans=1, wa=1000000007;
    cin >> n;
    for(int i=0;i<n;++i) b[i]=0;
    for(int i=0;i<n;++i){
        cin >> a;
        ++b[a];
    }
    if(b[0]>=2){
        cout << "0" << endl;
        return 0;
    }
    for(int i=0;i<n;++i){
        if(b[i]>2){
            cout << "0" << endl;
            return 0;
        }
    }
    for(int i=0;i<n/2;++i){
        ans *= 2;
        ans %= wa;
    }
    cout << ans << endl;
}