n = int(eval(input()))

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

mod = 10**9 + 7

def f():

  memo = {}



  for i in l:

    if i in memo:

      memo[i] += 1

    else:

      memo[i] = 1

  

  for k, v in list(memo.items()):

    if k == 0 and not v == 1:

      return 0

    elif not k == 0 and not v == 2:

      return 0

  

  return 2**(n//2) % mod



print((f()))
n = int(eval(input()))

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

mod = 10**9+7

if n % 2 == 0 and len(set(l)) == n//2:

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

elif not n % 2 == 0 and l.count(0) == 1:

  print((2**((n-1)//2)%mod))

else:

  print((0))
n = int(eval(input()))
l = list(map(int, input().split()))
mod = 10**9 + 7


def f():
    memo = {}
    for i in l:
        if i in memo:
            memo[i] += 1
        else:
            memo[i] = 1
    for k, v in list(memo.items()):
        if k == 0 and not v == 1:
            return 0
        elif not k == 0 and not v == 2:
            return 0
    return 2 ** (n // 2) % mod


print((f()))

n = int(eval(input()))
l = list(map(int, input().split()))
mod = 10**9 + 7
if n % 2 == 0 and len(set(l)) == n // 2:
    print((2 ** (n // 2) % mod))
elif not n % 2 == 0 and l.count(0) == 1:
    print((2 ** ((n - 1) // 2) % mod))
else:
    print((0))

- - -def f(): -    memo = {} -    for i in l: -        if i in memo: -            memo[i] += 1 -        else: -            memo[i] = 1 -    for k, v in list(memo.items()): -        if k == 0 and not v == 1: -            return 0 -        elif not k == 0 and not v == 2: -            return 0 -    return 2 ** (n // 2) % mod - - -print((f())) +if n % 2 == 0 and len(set(l)) == n // 2: +    print((2 ** (n // 2) % mod)) +elif not n % 2 == 0 and l.count(0) == 1: +    print((2 ** ((n - 1) // 2) % mod)) +else: +    print((0))