// 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.4543315948409332x):
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const int Max=1e5+10;

const int Mod=1e9+7;

int a[Max];

int cnt[Max];

int main(){

    ios::sync_with_stdio(0);

    cin.tie(0);

    int n;

    cin>>n;

    ll sum=0;

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

        cin>>a[i];

        cnt[a[i]]++;

    }

    bool flag=1;

    ll ans=1;

    if(n&1){

        if(cnt[0]!=1){

            flag=0;

        }

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

            if(cnt[i]!=2){

                flag=0;

                break;

            }

        }

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

            if(cnt[i]){

                flag=0;

                break;

            }

        }

    }else{

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

            if(cnt[i]!=2){

                flag=0;

                break;

            }

        }

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

            if(cnt[i]){

                flag=0;

                break;

            }

        }

    }

    if(flag){

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

            ans=ans*2;

            ans%=Mod;

        }

    }else{

        ans=0;

    }

    cout<<ans<<endl;

    return 0;

}