from collections import Counter

n = int(eval(input()))

A = sorted(Counter([int(i) for i in input().split()]).most_common())



flag = 0

for i in range(len(A) - 1):

    if A[i + 1][0] - A[i][0] != 2:

        flag = 1



cnt = 0

for a in A:

    if a[0] == 0 and a[1] == 1:

        pass

    elif a[0] != 0 and a[1] == 2:

        cnt += 1

    else:

        flag = 1

        break

        

if flag == 1:

    print((0))

else:

    print((2 ** cnt % (10 ** 9 + 7)))       
from collections import Counter

mod = 10 ** 9 + 7

n = int(eval(input()))

A = Counter([int(i) for i in input().split()])



ans = 0

if n % 2 == 1:

    for k, v in list(A.items()):

        if k == 0 and v != 1:

            ans = 0

            break

        elif v >= 3:

            ans = 0

            break

        elif v == 2:

            ans += 1

else:

    for k, v in list(A.items()):

        if v != 2:

            ans = 0

            break

        else:

            ans += 1

            

if n == 1:

    if A[0] == 1:

        print((1))

    else:

        print((0))

elif ans == 0:

    print((0))

else:

    print((2 ** ans % mod))
from collections import Counter

n = int(eval(input()))
A = sorted(Counter([int(i) for i in input().split()]).most_common())
flag = 0
for i in range(len(A) - 1):
    if A[i + 1][0] - A[i][0] != 2:
        flag = 1
cnt = 0
for a in A:
    if a[0] == 0 and a[1] == 1:
        pass
    elif a[0] != 0 and a[1] == 2:
        cnt += 1
    else:
        flag = 1
        break
if flag == 1:
    print((0))
else:
    print((2**cnt % (10**9 + 7)))

from collections import Counter

mod = 10**9 + 7
n = int(eval(input()))
A = Counter([int(i) for i in input().split()])
ans = 0
if n % 2 == 1:
    for k, v in list(A.items()):
        if k == 0 and v != 1:
            ans = 0
            break
        elif v >= 3:
            ans = 0
            break
        elif v == 2:
            ans += 1
else:
    for k, v in list(A.items()):
        if v != 2:
            ans = 0
            break
        else:
            ans += 1
if n == 1:
    if A[0] == 1:
        print((1))
    else:
        print((0))
elif ans == 0:
    print((0))
else:
    print((2**ans % mod))

+mod = 10**9 + 7 -A = sorted(Counter([int(i) for i in input().split()]).most_common()) -flag = 0 -for i in range(len(A) - 1): -    if A[i + 1][0] - A[i][0] != 2: -        flag = 1 -cnt = 0 -for a in A: -    if a[0] == 0 and a[1] == 1: -        pass -    elif a[0] != 0 and a[1] == 2: -        cnt += 1 +A = Counter([int(i) for i in input().split()]) +ans = 0 +if n % 2 == 1: +    for k, v in list(A.items()): +        if k == 0 and v != 1: +            ans = 0 +            break +        elif v >= 3: +            ans = 0 +            break +        elif v == 2: +            ans += 1 +else: +    for k, v in list(A.items()): +        if v != 2: +            ans = 0 +            break +        else: +            ans += 1 +if n == 1: +    if A[0] == 1: +        print((1)) -        flag = 1 -        break -if flag == 1: +        print((0)) +elif ans == 0: -    print((2**cnt % (10**9 + 7))) +    print((2**ans % mod))