There are N people, conveniently numbered 1 through N. They were standing in a row yesterday, but now they are unsure of the order in which they were standing. However, each person remembered the following fact: the absolute difference of the number of the people who were standing to the left of that person, and the number of the people who were standing to the right of that person. According to their reports, the difference above for person i is A_i.  Based on these reports, find the number of the possible orders in which they were standing. Since it can be extremely large, print the answer modulo 10^9+7. Note that the reports may be incorrect and thus there may be no consistent order. In such a case, print 0.
N = input()
A = [int(x) for x in input().split()]

from collections import Counter

def f():
    cnt = Counter(A)
    test = True
    m = len(A) // 2
    for k, v in cnt.items():
        if v == 1:
            if test == True:
                test = False
                continue
        if v != 2 or k > m:
            return 0
    return pow(2, len(A)//2, 10**9 + 7)

print(f())
N = int(input())
A = [int(x) for x in input().split()]

def f():
    As = sorted(A)
    if N % 2:
        if As[0] != 0: return 0
        if any((i // 2 + 1)*2 != a for i,a in enumerate(As[1:])): return 0
    else:
        if any((i // 2)*2 + 1 != a for i,a in enumerate(As)): return 0
    return pow(2, N//2, 10**9 + 7)

print(f())