N = int(eval(input()))

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



A.sort()

mod = 10 ** 9 + 7

i = 0

res = 0

if N == 1:

  if A[0] == 0:

    print((1))

  else:

    print((0))

  exit(0)

if N % 2 == 1:

  res = 1

  i = 1

  if A[0] == A[1]:

    print((0))

    exit(0)

  if A[0] == 1:

    print((0))

    exit(0)

else:

  res = 2

  i = 2

  if A[0] != A[1]:

    print((0))

    exit(0)

  if A[0] == 0:

    print((0))

    exit(0)

while i < N - 1:

  if A[i] == A[i + 1]:

    if N % 2 == 0:

      if A[i] != 2 * (i / 2 + 1) - 1:

        res = 0

        break

    else:

      if A[i] != 2 * (i // 2 + 1):

        res = 0

        break

    res *= 2

    i += 2

  else:

    res = 0

    break

print((res % mod))
N = int(eval(input()))

A = sorted(map(int,input().split()))

B = []



if N%2:

	B = [0]

	for i in range(N//2):

		B += [(i + 1)*2]*2

else:

	for i in range(N//2):

		B += [i*2 + 1]*2	

#print(A, B)

#print(B)

if A==B:

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

else:

	print((0))





N = int(eval(input()))
A = list(map(int, input().split()))
A.sort()
mod = 10**9 + 7
i = 0
res = 0
if N == 1:
    if A[0] == 0:
        print((1))
    else:
        print((0))
    exit(0)
if N % 2 == 1:
    res = 1
    i = 1
    if A[0] == A[1]:
        print((0))
        exit(0)
    if A[0] == 1:
        print((0))
        exit(0)
else:
    res = 2
    i = 2
    if A[0] != A[1]:
        print((0))
        exit(0)
    if A[0] == 0:
        print((0))
        exit(0)
while i < N - 1:
    if A[i] == A[i + 1]:
        if N % 2 == 0:
            if A[i] != 2 * (i / 2 + 1) - 1:
                res = 0
                break
        else:
            if A[i] != 2 * (i // 2 + 1):
                res = 0
                break
        res *= 2
        i += 2
    else:
        res = 0
        break
print((res % mod))

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

-A = list(map(int, input().split())) -A.sort() -mod = 10**9 + 7 -i = 0 -res = 0 -if N == 1: -    if A[0] == 0: -        print((1)) -    else: -        print((0)) -    exit(0) -if N % 2 == 1: -    res = 1 -    i = 1 -    if A[0] == A[1]: -        print((0)) -        exit(0) -    if A[0] == 1: -        print((0)) -        exit(0) +A = sorted(map(int, input().split())) +B = [] +if N % 2: +    B = [0] +    for i in range(N // 2): +        B += [(i + 1) * 2] * 2 -    res = 2 -    i = 2 -    if A[0] != A[1]: -        print((0)) -        exit(0) -    if A[0] == 0: -        print((0)) -        exit(0) -while i < N - 1: -    if A[i] == A[i + 1]: -        if N % 2 == 0: -            if A[i] != 2 * (i / 2 + 1) - 1: -                res = 0 -                break -        else: -            if A[i] != 2 * (i // 2 + 1): -                res = 0 -                break -        res *= 2 -        i += 2 -    else: -        res = 0 -        break -print((res % mod)) +    for i in range(N // 2): +        B += [i * 2 + 1] * 2 +# print(A, B) +# print(B) +if A == B: +    print((2 ** (N // 2) % ((10**9) + 7))) +else: +    print((0))