import collections

n = int(eval(input()))

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

dd = collections.defaultdict(int)

correct = []

if n % 2 == 1:

    correct.append(0)

    for i in range((n - 1) // 2):

        correct.append(2 * i + 2)

        correct.append(2 * i + 2)

else:

    correct.append(1)

    correct.append(1)

    for i in range(n // 2):

        correct.append(2 * i + 3)

        correct.append(2 * i + 3)

a.sort()

correct.sort()

for i in range(n):

    if a[i] != correct[i]:

        print((0))

        exit()

for i in range(n):

    dd[str(a[i])] += 1

ans = 1

for k in list(dd.keys()):

    if dd[k] >= 2:

        ans *= 2

        ans %= 10 ** 9 + 7

print(ans)
n = int(eval(input()))

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

a = sorted(a)

if n % 2 == 1:

    if a[0] != 0:

        print((0))

        exit()

    for i in range(1, n, 2):

        if a[i] != a[i + 1] or a[i] != i + 1:

            print((0))

            exit()

else:

    for i in range(0, n, 2):

        if a[i] != a[i + 1] or a[i] != i + 1:

            print((0))

            exit()

print((2 ** (n // 2) % (10 ** 9 + 7)))
import collections

n = int(eval(input()))
a = list(map(int, input().split()))
dd = collections.defaultdict(int)
correct = []
if n % 2 == 1:
    correct.append(0)
    for i in range((n - 1) // 2):
        correct.append(2 * i + 2)
        correct.append(2 * i + 2)
else:
    correct.append(1)
    correct.append(1)
    for i in range(n // 2):
        correct.append(2 * i + 3)
        correct.append(2 * i + 3)
a.sort()
correct.sort()
for i in range(n):
    if a[i] != correct[i]:
        print((0))
        exit()
for i in range(n):
    dd[str(a[i])] += 1
ans = 1
for k in list(dd.keys()):
    if dd[k] >= 2:
        ans *= 2
        ans %= 10**9 + 7
print(ans)

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

-import collections - -dd = collections.defaultdict(int) -correct = [] +a = sorted(a) -    correct.append(0) -    for i in range((n - 1) // 2): -        correct.append(2 * i + 2) -        correct.append(2 * i + 2) -else: -    correct.append(1) -    correct.append(1) -    for i in range(n // 2): -        correct.append(2 * i + 3) -        correct.append(2 * i + 3) -a.sort() -correct.sort() -for i in range(n): -    if a[i] != correct[i]: +    if a[0] != 0: -for i in range(n): -    dd[str(a[i])] += 1 -ans = 1 -for k in list(dd.keys()): -    if dd[k] >= 2: -        ans *= 2 -        ans %= 10**9 + 7 -print(ans) +    for i in range(1, n, 2): +        if a[i] != a[i + 1] or a[i] != i + 1: +            print((0)) +            exit() +else: +    for i in range(0, n, 2): +        if a[i] != a[i + 1] or a[i] != i + 1: +            print((0)) +            exit() +print((2 ** (n // 2) % (10**9 + 7)))