n=int(eval(input()))

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

def valid():

    b = list(range((n+1)&1, n+1, 2))

    for i in range(len(b)-1, -1, -1):

        b.insert(i, b[i])

    if b[0] == 0:

        b = b[1:]

    return list(sorted(a)) == b

ans,mod = 1,10**9+7

for i in range(n//2):

    ans = (ans * 2) % mod

print((ans if valid() else 0))
n=int(eval(input()))

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

def valid():

    cur=(n+1)&1

    for i in range(n):

        if n&1==0 and i&1==0 and i>0:

            cur+=2

        if n&1==1 and i&1==1:

            cur+=2

        if a[i] != cur: return False

    return True

print((2**(n//2)%(10**9+7) if valid() else 0))
n = int(eval(input()))
a = list(map(int, input().split()))


def valid():
    b = list(range((n + 1) & 1, n + 1, 2))
    for i in range(len(b) - 1, -1, -1):
        b.insert(i, b[i])
    if b[0] == 0:
        b = b[1:]
    return list(sorted(a)) == b


ans, mod = 1, 10**9 + 7
for i in range(n // 2):
    ans = (ans * 2) % mod
print((ans if valid() else 0))

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


def valid():
    cur = (n + 1) & 1
    for i in range(n):
        if n & 1 == 0 and i & 1 == 0 and i > 0:
            cur += 2
        if n & 1 == 1 and i & 1 == 1:
            cur += 2
        if a[i] != cur:
            return False
    return True


print((2 ** (n // 2) % (10**9 + 7) if valid() else 0))

-a = list(map(int, input().split())) +a = list(sorted(map(int, input().split()))) -    b = list(range((n + 1) & 1, n + 1, 2)) -    for i in range(len(b) - 1, -1, -1): -        b.insert(i, b[i]) -    if b[0] == 0: -        b = b[1:] -    return list(sorted(a)) == b +    cur = (n + 1) & 1 +    for i in range(n): +        if n & 1 == 0 and i & 1 == 0 and i > 0: +            cur += 2 +        if n & 1 == 1 and i & 1 == 1: +            cur += 2 +        if a[i] != cur: +            return False +    return True -ans, mod = 1, 10**9 + 7 -for i in range(n // 2): -    ans = (ans * 2) % mod -print((ans if valid() else 0)) +print((2 ** (n // 2) % (10**9 + 7) if valid() else 0))