from collections import Counter

N = int(eval(input()))

AC = Counter(list(map(int, input().split())))

if N % 2 == 1:

    if N == 1:

        ans = AC[0] == 1

    else:

        ans = AC[0] == 1

        for k, v in AC.most_common(N//2):

            if k > N-1 or k % 2 != 0 or v != 2:

                ans = False

                break

else:

    ans = True

    for k, v in AC.most_common():

        if k > N or k % 2 == 0 or v != 2:

            ans = False

            break

if ans:

    print((pow(2, N//2, 10**9+7)))

else:

    print((0))
from collections import Counter

N = int(eval(input()))

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

Ac = Counter(Alist)

mod = 10**9+7

if N%2==0:

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

        if Ac[i] != 2:

            print((0))

            break

    else:

        print((pow(2, (N//2), mod)))

else:

    if Ac[0] != 1:

        print((0))

    else:

        for i in range(2, N, 2):

            if Ac[i] != 2:

                print((0))

                break

        else:

            print((pow(2, (N//2), mod)))

from collections import Counter

N = int(eval(input()))
AC = Counter(list(map(int, input().split())))
if N % 2 == 1:
    if N == 1:
        ans = AC[0] == 1
    else:
        ans = AC[0] == 1
        for k, v in AC.most_common(N // 2):
            if k > N - 1 or k % 2 != 0 or v != 2:
                ans = False
                break
else:
    ans = True
    for k, v in AC.most_common():
        if k > N or k % 2 == 0 or v != 2:
            ans = False
            break
if ans:
    print((pow(2, N // 2, 10**9 + 7)))
else:
    print((0))

from collections import Counter

N = int(eval(input()))
Alist = list(map(int, input().split()))
Ac = Counter(Alist)
mod = 10**9 + 7
if N % 2 == 0:
    for i in range(1, N, 2):
        if Ac[i] != 2:
            print((0))
            break
    else:
        print((pow(2, (N // 2), mod)))
else:
    if Ac[0] != 1:
        print((0))
    else:
        for i in range(2, N, 2):
            if Ac[i] != 2:
                print((0))
                break
        else:
            print((pow(2, (N // 2), mod)))

-AC = Counter(list(map(int, input().split()))) -if N % 2 == 1: -    if N == 1: -        ans = AC[0] == 1 +Alist = list(map(int, input().split())) +Ac = Counter(Alist) +mod = 10**9 + 7 +if N % 2 == 0: +    for i in range(1, N, 2): +        if Ac[i] != 2: +            print((0)) +            break -        ans = AC[0] == 1 -        for k, v in AC.most_common(N // 2): -            if k > N - 1 or k % 2 != 0 or v != 2: -                ans = False +        print((pow(2, (N // 2), mod))) +else: +    if Ac[0] != 1: +        print((0)) +    else: +        for i in range(2, N, 2): +            if Ac[i] != 2: +                print((0)) -else: -    ans = True -    for k, v in AC.most_common(): -        if k > N or k % 2 == 0 or v != 2: -            ans = False -            break -if ans: -    print((pow(2, N // 2, 10**9 + 7))) -else: -    print((0)) +        else: +            print((pow(2, (N // 2), mod)))