import itertools

n = int(eval(input()))

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

g = itertools.groupby(sorted(a))

for i,(k,v) in enumerate(g):

    if n%2==1:

        f1 = i==0 and k==0 and len(list(v))==1

        f2 = i!=0 and k==i*2 and len(list(v))==2

        if not (f1 or f2):

            print((0))

            exit()

    else:

        if k!=2*i+1 or len(list(v))!=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



arr = []

if n%2==0:

    for i in range(1,n,2):

        arr += [i,i]

else:

    arr += [0]

    for i in range(2,n,2):

        arr += [i,i]



if sorted(a)!=sorted(arr):

    print((0))

    exit()



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

import itertools

n = int(eval(input()))
a = list(map(int, input().split()))
g = itertools.groupby(sorted(a))
for i, (k, v) in enumerate(g):
    if n % 2 == 1:
        f1 = i == 0 and k == 0 and len(list(v)) == 1
        f2 = i != 0 and k == i * 2 and len(list(v)) == 2
        if not (f1 or f2):
            print((0))
            exit()
    else:
        if k != 2 * i + 1 or len(list(v)) != 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
arr = []
if n % 2 == 0:
    for i in range(1, n, 2):
        arr += [i, i]
else:
    arr += [0]
    for i in range(2, n, 2):
        arr += [i, i]
if sorted(a) != sorted(arr):
    print((0))
    exit()
print((pow(2, n // 2, MOD)))

-import itertools - -g = itertools.groupby(sorted(a)) -for i, (k, v) in enumerate(g): -    if n % 2 == 1: -        f1 = i == 0 and k == 0 and len(list(v)) == 1 -        f2 = i != 0 and k == i * 2 and len(list(v)) == 2 -        if not (f1 or f2): -            print((0)) -            exit() -    else: -        if k != 2 * i + 1 or len(list(v)) != 2: -            print((0)) -            exit() -print(((2 ** (n // 2)) % (10**9 + 7))) +MOD = 10**9 + 7 +arr = [] +if n % 2 == 0: +    for i in range(1, n, 2): +        arr += [i, i] +else: +    arr += [0] +    for i in range(2, n, 2): +        arr += [i, i] +if sorted(a) != sorted(arr): +    print((0)) +    exit() +print((pow(2, n // 2, MOD)))