n = int(eval(input()))

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

l=[0 for i in range(n)]

for x in a:

    l[x] += 1

p = [(0 if i % 2 == 0 else 2) for i in range(n // 2 * 2)]

if n % 2 == 1: p = [1] + p

if l != p:

    print((0))

    import sys

    sys.exit()





def mod_power(x, a, p):

    if a == 0:

        return 1

    t = mod_power(x, a // 2, p)

    if a % 2 == 0:

        return t * t

    else:

        return x * t % p * t



ans = 1

for i in range(n // 2):

    ans *= 2

    ans %= 10 ** 9 + 7

print(ans)

# print(mod_power(2,n//2,10**9+7))

n = int(eval(input()))

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

l=[0 for i in range(n)]

for x in a:

    l[x] += 1

p = [(0 if i % 2 == 0 else 2) for i in range(n // 2 * 2)]

if n % 2 == 1: p = [1] + p

if l != p:

    print((0))

    import sys

    sys.exit()





def mod_power(x, a, p):

    if a == 0:

        return 1

    t = mod_power(x, a // 2, p)

    if a % 2 == 0:

        return t * t % p

    else:

        return x * t * t % p



ans = 1

# for i in range(n // 2):

#     ans *= 2

#     ans %= 10 ** 9 + 7

# print(ans)

print((mod_power(2,n//2,10**9+7)))

n = int(eval(input()))
a = list(map(int, input().split()))
l = [0 for i in range(n)]
for x in a:
    l[x] += 1
p = [(0 if i % 2 == 0 else 2) for i in range(n // 2 * 2)]
if n % 2 == 1:
    p = [1] + p
if l != p:
    print((0))
    import sys

    sys.exit()


def mod_power(x, a, p):
    if a == 0:
        return 1
    t = mod_power(x, a // 2, p)
    if a % 2 == 0:
        return t * t
    else:
        return x * t % p * t


ans = 1
for i in range(n // 2):
    ans *= 2
    ans %= 10**9 + 7
print(ans)
# print(mod_power(2,n//2,10**9+7))

n = int(eval(input()))
a = list(map(int, input().split()))
l = [0 for i in range(n)]
for x in a:
    l[x] += 1
p = [(0 if i % 2 == 0 else 2) for i in range(n // 2 * 2)]
if n % 2 == 1:
    p = [1] + p
if l != p:
    print((0))
    import sys

    sys.exit()


def mod_power(x, a, p):
    if a == 0:
        return 1
    t = mod_power(x, a // 2, p)
    if a % 2 == 0:
        return t * t % p
    else:
        return x * t * t % p


ans = 1
# for i in range(n // 2):
#     ans *= 2
#     ans %= 10 ** 9 + 7
# print(ans)
print((mod_power(2, n // 2, 10**9 + 7)))

-        return t * t +        return t * t % p -        return x * t % p * t +        return x * t * t % p -for i in range(n // 2): -    ans *= 2 -    ans %= 10**9 + 7 -print(ans) -# print(mod_power(2,n//2,10**9+7)) +# for i in range(n // 2): +#     ans *= 2 +#     ans %= 10 ** 9 + 7 +# print(ans) +print((mod_power(2, n // 2, 10**9 + 7)))