import sys



sys.setrecursionlimit(10 ** 7)

f_inf = float('inf')

mod = 10 ** 9 + 7





def resolve():

    n = int(eval(input()))

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



    if n % 2 != 0:

        for i in range(n):

            if i == 0:

                if A[i] != 0:

                    print((0))

                    break

            else:

                if i % 2 != 0:

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

                        print((0))

                        break

                else:

                    if A[i] != A[i - 1]:

                        print((0))

                        break

        else:

            res = pow(2, n // 2, mod)

            print(res)

    else:

        for i in range(n):

            if i == 0:

                if A[i] != 1:

                    print((0))

                    break

            else:

                if i % 2 == 0:

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

                        print((0))

                        break

                else:

                    if A[i] != A[i - 1]:

                        print((0))

                        break

        else:

            res = pow(2, n // 2, mod)

            print(res)





if __name__ == '__main__':

    resolve()

import sys



sys.setrecursionlimit(10 ** 7)

input = sys.stdin.readline

f_inf = float('inf')

mod = 10 ** 9 + 7





def resolve():

    n = int(eval(input()))

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

    if n % 2 == 0:

        num = 1

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

            if A[i] != num or A[i + 1] != num:

                print((0))

                exit()

            num += 2

    else:

        if A[0] != 0:

            print((0))

            exit()

        num = 2

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

            if A[i] != num or A[i + 1] != num:

                print((0))

                exit()

            num += 2



    res = pow(2, n // 2, mod)

    print((res % mod))





if __name__ == '__main__':

    resolve()

import sys

sys.setrecursionlimit(10**7)
f_inf = float("inf")
mod = 10**9 + 7


def resolve():
    n = int(eval(input()))
    A = sorted(list(map(int, input().split())))
    if n % 2 != 0:
        for i in range(n):
            if i == 0:
                if A[i] != 0:
                    print((0))
                    break
            else:
                if i % 2 != 0:
                    if A[i] - A[i - 1] != 2:
                        print((0))
                        break
                else:
                    if A[i] != A[i - 1]:
                        print((0))
                        break
        else:
            res = pow(2, n // 2, mod)
            print(res)
    else:
        for i in range(n):
            if i == 0:
                if A[i] != 1:
                    print((0))
                    break
            else:
                if i % 2 == 0:
                    if A[i] - A[i - 1] != 2:
                        print((0))
                        break
                else:
                    if A[i] != A[i - 1]:
                        print((0))
                        break
        else:
            res = pow(2, n // 2, mod)
            print(res)


if __name__ == "__main__":
    resolve()

import sys

sys.setrecursionlimit(10**7)
input = sys.stdin.readline
f_inf = float("inf")
mod = 10**9 + 7


def resolve():
    n = int(eval(input()))
    A = sorted(list(map(int, input().split())))
    if n % 2 == 0:
        num = 1
        for i in range(0, n - 1, 2):
            if A[i] != num or A[i + 1] != num:
                print((0))
                exit()
            num += 2
    else:
        if A[0] != 0:
            print((0))
            exit()
        num = 2
        for i in range(1, n - 1, 2):
            if A[i] != num or A[i + 1] != num:
                print((0))
                exit()
            num += 2
    res = pow(2, n // 2, mod)
    print((res % mod))


if __name__ == "__main__":
    resolve()

+input = sys.stdin.readline -    if n % 2 != 0: -        for i in range(n): -            if i == 0: -                if A[i] != 0: -                    print((0)) -                    break -            else: -                if i % 2 != 0: -                    if A[i] - A[i - 1] != 2: -                        print((0)) -                        break -                else: -                    if A[i] != A[i - 1]: -                        print((0)) -                        break -        else: -            res = pow(2, n // 2, mod) -            print(res) +    if n % 2 == 0: +        num = 1 +        for i in range(0, n - 1, 2): +            if A[i] != num or A[i + 1] != num: +                print((0)) +                exit() +            num += 2 -        for i in range(n): -            if i == 0: -                if A[i] != 1: -                    print((0)) -                    break -            else: -                if i % 2 == 0: -                    if A[i] - A[i - 1] != 2: -                        print((0)) -                        break -                else: -                    if A[i] != A[i - 1]: -                        print((0)) -                        break -        else: -            res = pow(2, n // 2, mod) -            print(res) +        if A[0] != 0: +            print((0)) +            exit() +        num = 2 +        for i in range(1, n - 1, 2): +            if A[i] != num or A[i + 1] != num: +                print((0)) +                exit() +            num += 2 +    res = pow(2, n // 2, mod) +    print((res % mod))