a = int(eval(input()))

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

b.sort()

c = 1 if a % 2 == 0 else 0

for i in range(a):

    if (a % 2) ^ (i % 2) == 0 and i != 0:

        c += 2

    if b[i] != c:

        print((0))

        exit()

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

a = int(eval(input()))

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

b.sort()

if a % 2 == 0:

    c = 1

    for i in range(len(b)):

        if i > 0 and i % 2 == 0:

            c += 2

        if b[i] != c:

            print((0))

            exit()

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

else:

    c = 0

    for i in range(len(b)):

        if i > 0 and i % 2 == 1:

            c += 2

        if b[i] != c:

            print((0))

            exit()

    print(((2 ** ((a-1) // 2)) % (10 ** 9 + 7)))

a = int(eval(input()))
b = list(map(int, input().split()))
b.sort()
c = 1 if a % 2 == 0 else 0
for i in range(a):
    if (a % 2) ^ (i % 2) == 0 and i != 0:
        c += 2
    if b[i] != c:
        print((0))
        exit()
print(((2 ** (a // 2)) % (10**9 + 7)))

a = int(eval(input()))
b = list(map(int, input().split()))
b.sort()
if a % 2 == 0:
    c = 1
    for i in range(len(b)):
        if i > 0 and i % 2 == 0:
            c += 2
        if b[i] != c:
            print((0))
            exit()
    print(((2 ** (a // 2)) % (10**9 + 7)))
else:
    c = 0
    for i in range(len(b)):
        if i > 0 and i % 2 == 1:
            c += 2
        if b[i] != c:
            print((0))
            exit()
    print(((2 ** ((a - 1) // 2)) % (10**9 + 7)))

-c = 1 if a % 2 == 0 else 0 -for i in range(a): -    if (a % 2) ^ (i % 2) == 0 and i != 0: -        c += 2 -    if b[i] != c: -        print((0)) -        exit() -print(((2 ** (a // 2)) % (10**9 + 7))) +if a % 2 == 0: +    c = 1 +    for i in range(len(b)): +        if i > 0 and i % 2 == 0: +            c += 2 +        if b[i] != c: +            print((0)) +            exit() +    print(((2 ** (a // 2)) % (10**9 + 7))) +else: +    c = 0 +    for i in range(len(b)): +        if i > 0 and i % 2 == 1: +            c += 2 +        if b[i] != c: +            print((0)) +            exit() +    print(((2 ** ((a - 1) // 2)) % (10**9 + 7)))