from math import ceil

from collections import Counter



N = int(eval(input()))

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

CA = Counter(A)

SCA = sorted(list(CA.items()), key=lambda x:x[0])



if len(CA) != ceil(N / 2):

  print((0))

  exit()



if N % 2 == 0:

  for i, j in zip(SCA, list(range(ceil(N / 2)))):

    if not (i[0] == 1 + j * 2 and i[1] == 2):

      print((0))

      exit()

else:

  for i, j in zip(SCA, list(range(ceil(N / 2)))):

    if j == 0:

      if not (i[0] == j * 2 and i[1] == 1 ):

        print((0))

        exit() 

    else:  

      if not (i[0] == j * 2 and i[1] == 2 ):

        print((0))

        exit()

print(((2 ** (N // 2)) % (10 ** 9 + 7)))
n = int(eval(input()))

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

MOD = 10 ** 9 + 7

A.sort()

if n % 2 == 0:

  if A[::2] == A[1::2] == [i for i in range(1, n + 1, 2)]:

    ans = 2 ** (n // 2)

  else:

    ans = 0

else:

  if A == [0] or A[1::2] == A[2::2] == [i for i in range(2, n + 1, 2)]:

    ans = 2 ** (n // 2)

  else:

    ans = 0

print((ans % MOD))
from math import ceil
from collections import Counter

N = int(eval(input()))
A = list(map(int, input().split()))
CA = Counter(A)
SCA = sorted(list(CA.items()), key=lambda x: x[0])
if len(CA) != ceil(N / 2):
    print((0))
    exit()
if N % 2 == 0:
    for i, j in zip(SCA, list(range(ceil(N / 2)))):
        if not (i[0] == 1 + j * 2 and i[1] == 2):
            print((0))
            exit()
else:
    for i, j in zip(SCA, list(range(ceil(N / 2)))):
        if j == 0:
            if not (i[0] == j * 2 and i[1] == 1):
                print((0))
                exit()
        else:
            if not (i[0] == j * 2 and i[1] == 2):
                print((0))
                exit()
print(((2 ** (N // 2)) % (10**9 + 7)))

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

-from math import ceil -from collections import Counter - -N = int(eval(input())) +n = int(eval(input())) -CA = Counter(A) -SCA = sorted(list(CA.items()), key=lambda x: x[0]) -if len(CA) != ceil(N / 2): -    print((0)) -    exit() -if N % 2 == 0: -    for i, j in zip(SCA, list(range(ceil(N / 2)))): -        if not (i[0] == 1 + j * 2 and i[1] == 2): -            print((0)) -            exit() +MOD = 10**9 + 7 +A.sort() +if n % 2 == 0: +    if A[::2] == A[1::2] == [i for i in range(1, n + 1, 2)]: +        ans = 2 ** (n // 2) +    else: +        ans = 0 -    for i, j in zip(SCA, list(range(ceil(N / 2)))): -        if j == 0: -            if not (i[0] == j * 2 and i[1] == 1): -                print((0)) -                exit() -        else: -            if not (i[0] == j * 2 and i[1] == 2): -                print((0)) -                exit() -print(((2 ** (N // 2)) % (10**9 + 7))) +    if A == [0] or A[1::2] == A[2::2] == [i for i in range(2, n + 1, 2)]: +        ans = 2 ** (n // 2) +    else: +        ans = 0 +print((ans % MOD))