mod = 10 ** 9 + 7

N = int(eval(input()))

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

A.sort()



if N % 2 != 0:

    if A[0] == 0:

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

            if not (A[i] == i and A[i-1] == i):

                print((0))

                exit()

        order_count = 2 ** ((N - 1) // 2) % mod

    else:

        print((0))

        exit()



else:

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

        if not (A[i] == i and A[i-1] == i):

            print((0))

            exit()

    order_count = 2 ** (N // 2) % mod 



print(order_count)
import sys

from collections import Counter



MOD = 10 ** 9 + 7



n, *a = list(map(int, sys.stdin.read().split()))



def main():

    c = Counter(a)

    if n & 1:

        if c.get(0, 0) != 1:

            return 0

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

            if c.get(i, 0) != 2:

                return 0

    else:

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

            if c.get(i, 0) != 2:

                return 0



    return pow(2, n // 2, MOD)

    

if __name__ == '__main__':

    ans = main()

    print(ans)
mod = 10**9 + 7
N = int(eval(input()))
A = [int(a) for a in input().split()]
A.sort()
if N % 2 != 0:
    if A[0] == 0:
        for i in range(2, N, 2):
            if not (A[i] == i and A[i - 1] == i):
                print((0))
                exit()
        order_count = 2 ** ((N - 1) // 2) % mod
    else:
        print((0))
        exit()
else:
    for i in range(1, N, 2):
        if not (A[i] == i and A[i - 1] == i):
            print((0))
            exit()
    order_count = 2 ** (N // 2) % mod
print(order_count)

import sys
from collections import Counter

MOD = 10**9 + 7
n, *a = list(map(int, sys.stdin.read().split()))


def main():
    c = Counter(a)
    if n & 1:
        if c.get(0, 0) != 1:
            return 0
        for i in range(2, n, 2):
            if c.get(i, 0) != 2:
                return 0
    else:
        for i in range(1, n, 2):
            if c.get(i, 0) != 2:
                return 0
    return pow(2, n // 2, MOD)


if __name__ == "__main__":
    ans = main()
    print(ans)

-mod = 10**9 + 7 -N = int(eval(input())) -A = [int(a) for a in input().split()] -A.sort() -if N % 2 != 0: -    if A[0] == 0: -        for i in range(2, N, 2): -            if not (A[i] == i and A[i - 1] == i): -                print((0)) -                exit() -        order_count = 2 ** ((N - 1) // 2) % mod +import sys +from collections import Counter + +MOD = 10**9 + 7 +n, *a = list(map(int, sys.stdin.read().split())) + + +def main(): +    c = Counter(a) +    if n & 1: +        if c.get(0, 0) != 1: +            return 0 +        for i in range(2, n, 2): +            if c.get(i, 0) != 2: +                return 0 -        print((0)) -        exit() -else: -    for i in range(1, N, 2): -        if not (A[i] == i and A[i - 1] == i): -            print((0)) -            exit() -    order_count = 2 ** (N // 2) % mod -print(order_count) +        for i in range(1, n, 2): +            if c.get(i, 0) != 2: +                return 0 +    return pow(2, n // 2, MOD) + + +if __name__ == "__main__": +    ans = main() +    print(ans)