// 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.4950617522126506x):
// ====================================

//   author: M_sea

//   website: https://m-sea-blog.com/

// ====================================

#include <bits/stdc++.h>

#define file(x) freopen(#x".in","r",stdin); freopen(#x".out","w",stdout)

#define debug(...) fprintf(stderr,__VA_ARGS__)

using namespace std;

typedef long long ll;



int read() {

	int X=0,w=1; char c=getchar();

	while (c<'0'||c>'9') { if (c=='-') w=-1; c=getchar(); }

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

	return X*w;

}



const int N=100000+10;

const int mod=1e9+7;

int qpow(int a,int b) { int c=1;

	for (;b;b>>=1,a=1ll*a*a%mod) if (b&1) c=1ll*c*a%mod;

	return c;

}



int n,a[N];



int main() {

	n=read();

	for (int i=1;i<=n;++i) a[i]=read();

	sort(a+1,a+n+1);

	if (n&1) {

		int flag=(a[1]==0);

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

			if (a[i]!=i||a[i+1]!=i) { flag=0; break; }

		if (flag) printf("%d\n",qpow(2,n/2));

		else puts("0");

	} else {

		int flag=1;

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

			if (a[i]!=i||a[i+1]!=i) { flag=0; break; }

		if (flag) printf("%d\n",qpow(2,n/2));

		else puts("0");

	}

	return 0;

}