n=int(eval(input()))

l=list(map(int,input().split()))

nOdd=len(l)%2==1

if nOdd:

    num=[x for x in range(n) if n%2==0]

else:

    num=[x for x in range(n) if n%2!=0]

dic={}

for i in num:

    dic[i]=0

for i in l:

    dic.setdefault(i,0)

    dic[i]+=1

for i,c in list(dic.items()):

    if i==0 and nOdd:

        if c!=1:

            print((0))

            exit()

    elif i==0 and not(nOdd):

        print((0))

        exit()

    elif c!=2:

        print((0))

        exit()

    





print((pow(2,n//2) % 1000000007))
import math

n=int(eval(input()))

arr=list(map(int,input().split()))

ans=True



if n%2!=0:

    if arr.count(0)!=1:

    	ans=False

    elif len(set(arr))!=int(n/2)+1:

        ans=False

else:

    if 0 in arr:

        ans=False

    elif len(set(arr))!=int(n/2):

        ans=False



if ans:

    print((2**math.floor(n/2)%((10**9)+7)))

else:

    print((0))
n = int(eval(input()))
l = list(map(int, input().split()))
nOdd = len(l) % 2 == 1
if nOdd:
    num = [x for x in range(n) if n % 2 == 0]
else:
    num = [x for x in range(n) if n % 2 != 0]
dic = {}
for i in num:
    dic[i] = 0
for i in l:
    dic.setdefault(i, 0)
    dic[i] += 1
for i, c in list(dic.items()):
    if i == 0 and nOdd:
        if c != 1:
            print((0))
            exit()
    elif i == 0 and not (nOdd):
        print((0))
        exit()
    elif c != 2:
        print((0))
        exit()
print((pow(2, n // 2) % 1000000007))

import math

n = int(eval(input()))
arr = list(map(int, input().split()))
ans = True
if n % 2 != 0:
    if arr.count(0) != 1:
        ans = False
    elif len(set(arr)) != int(n / 2) + 1:
        ans = False
else:
    if 0 in arr:
        ans = False
    elif len(set(arr)) != int(n / 2):
        ans = False
if ans:
    print((2 ** math.floor(n / 2) % ((10**9) + 7)))
else:
    print((0))

+import math + -l = list(map(int, input().split())) -nOdd = len(l) % 2 == 1 -if nOdd: -    num = [x for x in range(n) if n % 2 == 0] +arr = list(map(int, input().split())) +ans = True +if n % 2 != 0: +    if arr.count(0) != 1: +        ans = False +    elif len(set(arr)) != int(n / 2) + 1: +        ans = False -    num = [x for x in range(n) if n % 2 != 0] -dic = {} -for i in num: -    dic[i] = 0 -for i in l: -    dic.setdefault(i, 0) -    dic[i] += 1 -for i, c in list(dic.items()): -    if i == 0 and nOdd: -        if c != 1: -            print((0)) -            exit() -    elif i == 0 and not (nOdd): -        print((0)) -        exit() -    elif c != 2: -        print((0)) -        exit() -print((pow(2, n // 2) % 1000000007)) +    if 0 in arr: +        ans = False +    elif len(set(arr)) != int(n / 2): +        ans = False +if ans: +    print((2 ** math.floor(n / 2) % ((10**9) + 7))) +else: +    print((0))