n = int(eval(input()))

a = input().split()

int_a =[]

for i in range(len(a)):

    int_a.append(int(a[i]))

if n % 2 == 0:

    kakeru = n

else:

    kakeru = n + 1



if sum(int_a) == kakeru * (n // 2):

    syou = n // 2

    answer = 2 ** syou

    print((answer % ((10 ** 9) + 7)))

else:

    print("0")

n = int(eval(input()))

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



if n % 2 == 0:

    kakeru = n

else:

    kakeru = n + 1



if sum(int_a) == kakeru * (n // 2):

    syou = n // 2

    answer = 2 ** syou

    print((answer % ((10 ** 9) + 7)))

else:

    print("0")

n = int(eval(input()))
a = input().split()
int_a = []
for i in range(len(a)):
    int_a.append(int(a[i]))
if n % 2 == 0:
    kakeru = n
else:
    kakeru = n + 1
if sum(int_a) == kakeru * (n // 2):
    syou = n // 2
    answer = 2**syou
    print((answer % ((10**9) + 7)))
else:
    print("0")

n = int(eval(input()))
int_a = list(map(int, input().split()))
if n % 2 == 0:
    kakeru = n
else:
    kakeru = n + 1
if sum(int_a) == kakeru * (n // 2):
    syou = n // 2
    answer = 2**syou
    print((answer % ((10**9) + 7)))
else:
    print("0")

-a = input().split() -int_a = [] -for i in range(len(a)): -    int_a.append(int(a[i])) +int_a = list(map(int, input().split()))