from sys import stdin





def resolve():

    n = int(stdin.readline().rstrip())

    # s = stdin.readline().rstrip()

    # A, B, C = [int(x) for x in stdin.readline().rstrip().split()]

    a = [int(x) for x in stdin.readline().rstrip().split()]



    a = sorted(a)

    predict = [n - (((n - i + 1) // 2) * 2) + 1 for i in range(0, n)]

    if a != predict:

        return 0



    ret = 1

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

        ret = (ret * 2) % 1000000007

    return ret





print((resolve(), '\n'))

# print(*data, sep='\n')

import sys

from sys import stdin



mod = 1000000007



n = int(stdin.readline().rstrip())

# s = stdin.readline().rstrip()

# A, B, C = [int(x) for x in stdin.readline().rstrip().split()]

a = [int(x) for x in stdin.readline().rstrip().split()]



a = sorted(a)

predict = [n - (((n - i + 1) // 2) * 2) + 1 for i in range(0, n)]

if a != predict:

    print((0))

    sys.exit()

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

# print(*data, sep='\n')

from sys import stdin


def resolve():
    n = int(stdin.readline().rstrip())
    # s = stdin.readline().rstrip()
    # A, B, C = [int(x) for x in stdin.readline().rstrip().split()]
    a = [int(x) for x in stdin.readline().rstrip().split()]
    a = sorted(a)
    predict = [n - (((n - i + 1) // 2) * 2) + 1 for i in range(0, n)]
    if a != predict:
        return 0
    ret = 1
    for i in range(0, n // 2):
        ret = (ret * 2) % 1000000007
    return ret


print((resolve(), "\n"))
# print(*data, sep='\n')

import sys
from sys import stdin

mod = 1000000007
n = int(stdin.readline().rstrip())
# s = stdin.readline().rstrip()
# A, B, C = [int(x) for x in stdin.readline().rstrip().split()]
a = [int(x) for x in stdin.readline().rstrip().split()]
a = sorted(a)
predict = [n - (((n - i + 1) // 2) * 2) + 1 for i in range(0, n)]
if a != predict:
    print((0))
    sys.exit()
print((pow(2, (n // 2), mod)))
# print(*data, sep='\n')

+import sys - -def resolve(): -    n = int(stdin.readline().rstrip()) -    # s = stdin.readline().rstrip() -    # A, B, C = [int(x) for x in stdin.readline().rstrip().split()] -    a = [int(x) for x in stdin.readline().rstrip().split()] -    a = sorted(a) -    predict = [n - (((n - i + 1) // 2) * 2) + 1 for i in range(0, n)] -    if a != predict: -        return 0 -    ret = 1 -    for i in range(0, n // 2): -        ret = (ret * 2) % 1000000007 -    return ret - - -print((resolve(), "\n")) +mod = 1000000007 +n = int(stdin.readline().rstrip()) +# s = stdin.readline().rstrip() +# A, B, C = [int(x) for x in stdin.readline().rstrip().split()] +a = [int(x) for x in stdin.readline().rstrip().split()] +a = sorted(a) +predict = [n - (((n - i + 1) // 2) * 2) + 1 for i in range(0, n)] +if a != predict: +    print((0)) +    sys.exit() +print((pow(2, (n // 2), mod)))