n=int(eval(input()))

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

a.sort()

f=1

if n%2==0:

  for i in range(n):

    if i%2==0 and i+1!=a[i] or i%2==1 and i!=a[i]:

      f=0

      break

else:

  for i in range(n):

    if i%2==1 and i+1!=a[i] or i%2==0 and i!=a[i]:

      f=0

      break

if f==0:print((0))

else:

  ans=1

  for j in range(n//2):

    ans*=2

  print((ans%(10**9+7)))
n=int(eval(input()))

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

a.sort()

f=1

for i in range(n):

  if i%2==n%2 and i+1!=a[i] or i%2==(n+1)%2 and i!=a[i]:

    f=0

    break

if f==0:print((0))

else:print(((2**(n//2))%(10**9+7)))
n = int(eval(input()))
a = list(map(int, input().split()))
a.sort()
f = 1
if n % 2 == 0:
    for i in range(n):
        if i % 2 == 0 and i + 1 != a[i] or i % 2 == 1 and i != a[i]:
            f = 0
            break
else:
    for i in range(n):
        if i % 2 == 1 and i + 1 != a[i] or i % 2 == 0 and i != a[i]:
            f = 0
            break
if f == 0:
    print((0))
else:
    ans = 1
    for j in range(n // 2):
        ans *= 2
    print((ans % (10**9 + 7)))

n = int(eval(input()))
a = list(map(int, input().split()))
a.sort()
f = 1
for i in range(n):
    if i % 2 == n % 2 and i + 1 != a[i] or i % 2 == (n + 1) % 2 and i != a[i]:
        f = 0
        break
if f == 0:
    print((0))
else:
    print(((2 ** (n // 2)) % (10**9 + 7)))

-if n % 2 == 0: -    for i in range(n): -        if i % 2 == 0 and i + 1 != a[i] or i % 2 == 1 and i != a[i]: -            f = 0 -            break -else: -    for i in range(n): -        if i % 2 == 1 and i + 1 != a[i] or i % 2 == 0 and i != a[i]: -            f = 0 -            break +for i in range(n): +    if i % 2 == n % 2 and i + 1 != a[i] or i % 2 == (n + 1) % 2 and i != a[i]: +        f = 0 +        break -    ans = 1 -    for j in range(n // 2): -        ans *= 2 -    print((ans % (10**9 + 7))) +    print(((2 ** (n // 2)) % (10**9 + 7)))