N = int(eval(input()))

m = [2 * ((i - 1 + N % 2) // 2) + 1 - N % 2 for i in range(1, N + 1)]

for i, a in enumerate(sorted([int(a) for a in input().split()])):

  if m[i] != a:

    ret = 0

    break

else:

  ret = 2 ** (N // 2)



print((ret % (10 ** 9 + 7)))
N = int(eval(input()))

if [2 * ((i - 1 + N % 2) // 2) + 1 - N % 2 for i in range(1, N + 1)] == sorted([int(a) for a in input().split()]):

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

else:

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

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

-m = [2 * ((i - 1 + N % 2) // 2) + 1 - N % 2 for i in range(1, N + 1)] -for i, a in enumerate(sorted([int(a) for a in input().split()])): -    if m[i] != a: -        ret = 0 -        break +if [2 * ((i - 1 + N % 2) // 2) + 1 - N % 2 for i in range(1, N + 1)] == sorted( +    [int(a) for a in input().split()] +): +    print(((2 ** (N // 2)) % (10**9 + 7))) -    ret = 2 ** (N // 2) -print((ret % (10**9 + 7))) +    print((0))