#!/usr/bin/env python

# -*- coding:utf-8 -*-



from collections import Counter

import sys

N = int(eval(input()))

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



MOD = 10**9 + 7

A = Counter(A)



if N % 2 == 1:

    for num, cnt in list(A.items()):

        # print(num, cnt)

        if num == 0:

            if cnt != 1:

                print((0))

                sys.exit()

        else:

            if not (num % 2 == 0 and cnt == 2):

                print((0))

                sys.exit()

    print(((2 ** (N // 2)) % MOD))

else:

    for num, cnt in list(A.items()):

        # print(num, cnt)

        if not (num % 2 == 1 and cnt == 2):

            print((0))

            sys.exit()

    print(((2 ** (N // 2)) % MOD))

from collections import Counter



N = int(eval(input()))

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

# N = 5

# A = [2, 4, 4, 0, 2]

mod = 10 ** 9 + 7



cnt = Counter(A)

if N % 2 == 0:

    if len(list([c for c in list(cnt.values()) if c != 2])) != 0:

        print((0))

    else:

        print(((2 ** (N // 2)) % mod))

else:

    if cnt[0] != 1:

        print((0))

    else:

        cnt.pop(0)

        if len(list([c for c in list(cnt.values()) if c != 2])) != 0:

            print((0))

        else:

            print(((2 ** (N // 2)) % mod))

#!/usr/bin/env python
# -*- coding:utf-8 -*-
from collections import Counter
import sys

N = int(eval(input()))
A = list(map(int, input().split()))
MOD = 10**9 + 7
A = Counter(A)
if N % 2 == 1:
    for num, cnt in list(A.items()):
        # print(num, cnt)
        if num == 0:
            if cnt != 1:
                print((0))
                sys.exit()
        else:
            if not (num % 2 == 0 and cnt == 2):
                print((0))
                sys.exit()
    print(((2 ** (N // 2)) % MOD))
else:
    for num, cnt in list(A.items()):
        # print(num, cnt)
        if not (num % 2 == 1 and cnt == 2):
            print((0))
            sys.exit()
    print(((2 ** (N // 2)) % MOD))

from collections import Counter

N = int(eval(input()))
A = list(map(int, input().split()))
# N = 5
# A = [2, 4, 4, 0, 2]
mod = 10**9 + 7
cnt = Counter(A)
if N % 2 == 0:
    if len(list([c for c in list(cnt.values()) if c != 2])) != 0:
        print((0))
    else:
        print(((2 ** (N // 2)) % mod))
else:
    if cnt[0] != 1:
        print((0))
    else:
        cnt.pop(0)
        if len(list([c for c in list(cnt.values()) if c != 2])) != 0:
            print((0))
        else:
            print(((2 ** (N // 2)) % mod))

-#!/usr/bin/env python -# -*- coding:utf-8 -*- -import sys -MOD = 10**9 + 7 -A = Counter(A) -if N % 2 == 1: -    for num, cnt in list(A.items()): -        # print(num, cnt) -        if num == 0: -            if cnt != 1: -                print((0)) -                sys.exit() +# N = 5 +# A = [2, 4, 4, 0, 2] +mod = 10**9 + 7 +cnt = Counter(A) +if N % 2 == 0: +    if len(list([c for c in list(cnt.values()) if c != 2])) != 0: +        print((0)) +    else: +        print(((2 ** (N // 2)) % mod)) +else: +    if cnt[0] != 1: +        print((0)) +    else: +        cnt.pop(0) +        if len(list([c for c in list(cnt.values()) if c != 2])) != 0: +            print((0)) -            if not (num % 2 == 0 and cnt == 2): -                print((0)) -                sys.exit() -    print(((2 ** (N // 2)) % MOD)) -else: -    for num, cnt in list(A.items()): -        # print(num, cnt) -        if not (num % 2 == 1 and cnt == 2): -            print((0)) -            sys.exit() -    print(((2 ** (N // 2)) % MOD)) +            print(((2 ** (N // 2)) % mod))