from collections import Counter

n = int(eval(input()))

lst = [int(i) for i in input().split()]

mod = 10**9 + 7

lst_c = Counter(lst)

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



ideal = []



if n%2!=0:

    ideal.append((0,1))

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

        ideal.append((2*i,2))

else:

    for i in range(n//2):

        ideal.append((2*i+1,2))



if lst_c != ideal:

    print((0))

else:

    l = len(ideal)

    if n%2!=0:

        l -= 1

    print((2**l % mod))
from collections import Counter

n = int(eval(input()))

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

mod = 10**9 + 7

c = Counter(A)

flg = True

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

    if k==0:

        if v!=1:

            flg = False

    else:

        if v!=2:

            flg = False

if flg is False:

    print((0))

else:

    print((pow(2, n//2, mod)))
from collections import Counter

n = int(eval(input()))
lst = [int(i) for i in input().split()]
mod = 10**9 + 7
lst_c = Counter(lst)
lst_c = sorted(list(lst_c.items()), key=lambda x: x[0])
ideal = []
if n % 2 != 0:
    ideal.append((0, 1))
    for i in range(1, n // 2 + 1):
        ideal.append((2 * i, 2))
else:
    for i in range(n // 2):
        ideal.append((2 * i + 1, 2))
if lst_c != ideal:
    print((0))
else:
    l = len(ideal)
    if n % 2 != 0:
        l -= 1
    print((2**l % mod))

from collections import Counter

n = int(eval(input()))
A = list(map(int, input().split()))
mod = 10**9 + 7
c = Counter(A)
flg = True
for k, v in list(c.items()):
    if k == 0:
        if v != 1:
            flg = False
    else:
        if v != 2:
            flg = False
if flg is False:
    print((0))
else:
    print((pow(2, n // 2, mod)))

-lst = [int(i) for i in input().split()] +A = list(map(int, input().split())) -lst_c = Counter(lst) -lst_c = sorted(list(lst_c.items()), key=lambda x: x[0]) -ideal = [] -if n % 2 != 0: -    ideal.append((0, 1)) -    for i in range(1, n // 2 + 1): -        ideal.append((2 * i, 2)) -else: -    for i in range(n // 2): -        ideal.append((2 * i + 1, 2)) -if lst_c != ideal: +c = Counter(A) +flg = True +for k, v in list(c.items()): +    if k == 0: +        if v != 1: +            flg = False +    else: +        if v != 2: +            flg = False +if flg is False: -    l = len(ideal) -    if n % 2 != 0: -        l -= 1 -    print((2**l % mod)) +    print((pow(2, n // 2, mod)))