#include<bits/stdc++.h>
#define ll long long
#define For(i,x,y) for(int i=x;i<=y;i++)
#define Rep(i,x,y) for(int i=x;i>=y;i--)
#define Forn(i,x,y) for(int i=x;i<y;i++)
#define oo 1000000
#define zyy 1000000007
#define N 100005
using namespace std;
inline ll read(){ll x=0,f=0;char ch=getchar();for(;ch<'0'||ch>'9';ch=getchar()) if(ch=='-') f=1;for(;ch>='0'&&ch<='9';ch=getchar()) x=(x<<1)+(x<<3)+ch-48;return f?-x:x;}
inline void write(ll x){if(x<10) putchar(x+48);else write(x/10),putchar(x%10+48);}
inline void writeln(ll x){if(x<0) putchar('-'),x=-x;write(x);putchar('\n');}
int n,a[N],p[N];
int main(){
	n=read();For(i,1,n) a[i]=read();
	For(i,1,n) p[a[i]]++;
	if(p[0]==1&&n%2==0) return puts("0"),0;
	if(p[0]==0&&n%2==1) return puts("0"),0;
	int ans;
	if(n&1){
		for(int i=2;i<=n;i+=2) if(p[i]&1) return puts("0"),0;
		ans=1;for(int i=2;i<=n;i+=2) ans=ans*2%zyy;
	}else{
		for(int i=1;i<=n;i+=2) if(p[i]&1) return puts("0"),0;
		ans=1;for(int i=1;i<=n;i+=2) ans=ans*2%zyy;
	}
	writeln(ans);
	return 0;
}