

N = int(eval(input()))

A = [int(a) for a in input().split()]



check = []



if N % 2 == 0:

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

        check += [i, i]

else:

    check += [0]



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

        check += [i, i]



if check == sorted(A):

    print(((2 ** (N // 2)) % (10 ** 9 + 7)))

else:

    print((0))
from collections import Counter



N = int(eval(input()))

A = [int(a) for a in input().split()]

 

check = {}

 

if N % 2 == 0:

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

        check[i] = 2

else:

    check[0] = 1

 

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

        check[i] = 2

 

if check == Counter(A):

    print(((2 ** (N // 2)) % (10 ** 9 + 7)))

else:

    print((0))
N = int(eval(input()))
A = [int(a) for a in input().split()]
check = []
if N % 2 == 0:
    for i in range(1, N, 2):
        check += [i, i]
else:
    check += [0]
    for i in range(2, N, 2):
        check += [i, i]
if check == sorted(A):
    print(((2 ** (N // 2)) % (10**9 + 7)))
else:
    print((0))

from collections import Counter

N = int(eval(input()))
A = [int(a) for a in input().split()]
check = {}
if N % 2 == 0:
    for i in range(1, N, 2):
        check[i] = 2
else:
    check[0] = 1
    for i in range(2, N, 2):
        check[i] = 2
if check == Counter(A):
    print(((2 ** (N // 2)) % (10**9 + 7)))
else:
    print((0))

+from collections import Counter + -check = [] +check = {} -        check += [i, i] +        check[i] = 2 -    check += [0] +    check[0] = 1 -        check += [i, i] -if check == sorted(A): +        check[i] = 2 +if check == Counter(A):