n = int(eval(input())) 

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

sa = sorted(a) 



if n % 2 == 0:

  k = 1

  l = 0

else:

  k = 0

  l = 1 



a=1000000007

flag = True 

for i,s in enumerate(sa):

  if ((i+l)//2)*2+k != s:

    flag = False

if flag:

  print((2**(n//2) % a))

else:

  print((0)) 

n = int(eval(input()))

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



if n%2==0:

    if sorted(a) != [(k//2)*2+1 for k in range(n)]:

        print((0))

    else:

        ans = 2**(n//2)

        print((ans % (10**9+7)))

else:

    if sorted(a)!= [0]+[(k//2+1)*2 for k in range(n-1)]:

        print((0))

    else:

        ans = 2**(n//2)

        print((ans % (10**9+7)))
n = int(eval(input()))
a = list(map(int, input().split()))
sa = sorted(a)
if n % 2 == 0:
    k = 1
    l = 0
else:
    k = 0
    l = 1
a = 1000000007
flag = True
for i, s in enumerate(sa):
    if ((i + l) // 2) * 2 + k != s:
        flag = False
if flag:
    print((2 ** (n // 2) % a))
else:
    print((0))

n = int(eval(input()))
a = list(map(int, input().split()))
if n % 2 == 0:
    if sorted(a) != [(k // 2) * 2 + 1 for k in range(n)]:
        print((0))
    else:
        ans = 2 ** (n // 2)
        print((ans % (10**9 + 7)))
else:
    if sorted(a) != [0] + [(k // 2 + 1) * 2 for k in range(n - 1)]:
        print((0))
    else:
        ans = 2 ** (n // 2)
        print((ans % (10**9 + 7)))

-sa = sorted(a) -    k = 1 -    l = 0 +    if sorted(a) != [(k // 2) * 2 + 1 for k in range(n)]: +        print((0)) +    else: +        ans = 2 ** (n // 2) +        print((ans % (10**9 + 7))) -    k = 0 -    l = 1 -a = 1000000007 -flag = True -for i, s in enumerate(sa): -    if ((i + l) // 2) * 2 + k != s: -        flag = False -if flag: -    print((2 ** (n // 2) % a)) -else: -    print((0)) +    if sorted(a) != [0] + [(k // 2 + 1) * 2 for k in range(n - 1)]: +        print((0)) +    else: +        ans = 2 ** (n // 2) +        print((ans % (10**9 + 7)))