n = int(eval(input()))

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

ans = 0

if n%2==1:

    dummy = [0]

    for i in range(1, 1+(len(a)-1)//2):

        dummy.append(2*i)

        dummy.append(2*i)

    if sorted(a) == dummy:

        ans = 2**((len(a)-1)//2)

else:

    dummy = []

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

        dummy.append(2*i - 1)

        dummy.append(2*i - 1)

    if sorted(a) == dummy:

        ans = 2**((len(a))//2)

print((ans%(10**9 + 7)))
n = int(eval(input()))

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



if len(a)%2==1:

    tmp = [0]

    for i in range((len(a)-1)//2):

        tmp.append((i+1)*2)

        tmp.append((i+1)*2)

    if a == tmp:

        ans = (2**((len(a)-1)//2))%(10**9+7)

    else:

        ans = 0

else:

    tmp = []

    for i in range(len(a)//2):

        tmp.append(2*i+1)

        tmp.append(2*i+1)

    if a == tmp:

        ans = (2**(len(a)//2))%(10**9+7)

    else:

        ans = 0

print(ans)
n = int(eval(input()))
a = list(map(int, input().split()))
ans = 0
if n % 2 == 1:
    dummy = [0]
    for i in range(1, 1 + (len(a) - 1) // 2):
        dummy.append(2 * i)
        dummy.append(2 * i)
    if sorted(a) == dummy:
        ans = 2 ** ((len(a) - 1) // 2)
else:
    dummy = []
    for i in range(1, 1 + (len(a)) // 2):
        dummy.append(2 * i - 1)
        dummy.append(2 * i - 1)
    if sorted(a) == dummy:
        ans = 2 ** ((len(a)) // 2)
print((ans % (10**9 + 7)))

n = int(eval(input()))
a = sorted(list(map(int, input().split())))
if len(a) % 2 == 1:
    tmp = [0]
    for i in range((len(a) - 1) // 2):
        tmp.append((i + 1) * 2)
        tmp.append((i + 1) * 2)
    if a == tmp:
        ans = (2 ** ((len(a) - 1) // 2)) % (10**9 + 7)
    else:
        ans = 0
else:
    tmp = []
    for i in range(len(a) // 2):
        tmp.append(2 * i + 1)
        tmp.append(2 * i + 1)
    if a == tmp:
        ans = (2 ** (len(a) // 2)) % (10**9 + 7)
    else:
        ans = 0
print(ans)

-a = list(map(int, input().split())) -ans = 0 -if n % 2 == 1: -    dummy = [0] -    for i in range(1, 1 + (len(a) - 1) // 2): -        dummy.append(2 * i) -        dummy.append(2 * i) -    if sorted(a) == dummy: -        ans = 2 ** ((len(a) - 1) // 2) +a = sorted(list(map(int, input().split()))) +if len(a) % 2 == 1: +    tmp = [0] +    for i in range((len(a) - 1) // 2): +        tmp.append((i + 1) * 2) +        tmp.append((i + 1) * 2) +    if a == tmp: +        ans = (2 ** ((len(a) - 1) // 2)) % (10**9 + 7) +    else: +        ans = 0 -    dummy = [] -    for i in range(1, 1 + (len(a)) // 2): -        dummy.append(2 * i - 1) -        dummy.append(2 * i - 1) -    if sorted(a) == dummy: -        ans = 2 ** ((len(a)) // 2) -print((ans % (10**9 + 7))) +    tmp = [] +    for i in range(len(a) // 2): +        tmp.append(2 * i + 1) +        tmp.append(2 * i + 1) +    if a == tmp: +        ans = (2 ** (len(a) // 2)) % (10**9 + 7) +    else: +        ans = 0 +print(ans)