import sys

from numpy import *

n, *a = list(map(int, sys.stdin.read().split()))

a = int_(bincount(a, [1] * n, n))

print((pow(2, n // 2, 10 ** 9 + 7) if not a[0] > (n & 1) and all([x == 2 or x == 0 for x in a[1:]]) else 0))

mod = int(1e9) + 7

n = int(eval(input()))

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

lis = [0] * n

for i in a:

    lis[i] += 1

for i in range(1,n):

    if lis[i] % 2 == 1:

        print((0))

        exit()



print((pow(2, n//2, mod))) 

import sys
from numpy import *

n, *a = list(map(int, sys.stdin.read().split()))
a = int_(bincount(a, [1] * n, n))
print(
    (
        pow(2, n // 2, 10**9 + 7)
        if not a[0] > (n & 1) and all([x == 2 or x == 0 for x in a[1:]])
        else 0
    )
)

mod = int(1e9) + 7
n = int(eval(input()))
a = list(map(int, input().split()))
lis = [0] * n
for i in a:
    lis[i] += 1
for i in range(1, n):
    if lis[i] % 2 == 1:
        print((0))
        exit()
print((pow(2, n // 2, mod)))

-import sys -from numpy import * - -n, *a = list(map(int, sys.stdin.read().split())) -a = int_(bincount(a, [1] * n, n)) -print( -    ( -        pow(2, n // 2, 10**9 + 7) -        if not a[0] > (n & 1) and all([x == 2 or x == 0 for x in a[1:]]) -        else 0 -    ) -) +mod = int(1e9) + 7 +n = int(eval(input())) +a = list(map(int, input().split())) +lis = [0] * n +for i in a: +    lis[i] += 1 +for i in range(1, n): +    if lis[i] % 2 == 1: +        print((0)) +        exit() +print((pow(2, n // 2, mod)))