#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <iostream>
using namespace std;

#define rp(i,t) for(int i=0;i<(t);i++)
#define rep(i,s,t) for(int i=(s);i<=(t);i++)
#define rsp(i,s,t) for(int i=(s);i<(t);i++)
#define rrp(i,t,s) for(int i=(t);i>=(s);i--)
#define rcp(i,s,b,d) for(int i=(s);b;d)
#define mst(a,x) memset(a,x,sizeof(a))
#define INF 0x3f3f3f3f
#define N 100002
#define MOD 1000000007

#define Dp puts("")
#define Dw printf
#define Ds printf("#")

typedef long long ll;
char ch;
int n,c[N],x;
ll ans;

inline void read(int &x){x=0;do{ch=getchar();}while(ch<'0'||'9'<ch);do{x=x*10+ch-'0';ch=getchar();}while('0'<=ch&&ch<='9');}

inline ll pow2(int t)
{
	ll rtn=1,w=2;
	while(t)
	{
		if(t&1)rtn=rtn*w%MOD;
		w=w*w%MOD;
		t>>=1;
	}
	return rtn;
}

int main(void)
{
	read(n);
	rep(i,1,n)
	{
		read(x),c[x]++;
		if((n&1)&&(x&1))
		{
			printf("0");
			return 0;
		}
	}
	rep(i,1,n)if(c[i]!=0&&c[i]!=2){printf("0");return 0;}
	printf("%lld",pow2(n>>1));
	return 0;
}
