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

from collections import Counter



def main():

    n = int(eval(input()))

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

    counter = Counter(a_list)



    ans = 1

    if n % 2 != 0:

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

            c = counter[i]

            if (i == 0 and c != 1) or c == 0:

                print((0))

                exit()

            else:

                ans *= c

    else:

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

            c = counter[i]

            if c == 0:

                print((0))

                exit()

            else:

                ans *= c

    print((ans % (10 ** 9 + 7)))

        

if __name__ == '__main__':

    main()
#-*-coding:utf-8-*-

from collections import Counter



def main():

    n = int(eval(input()))

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

    counter = Counter(a_list)

    ans = 1



    if n % 2 == 0:

        if all(counter[i] == 2 for i in range(1, n, 2)):

            ans = 2 ** (n // 2)

        else:

            ans = 0

    else:

        if all(counter[i] == 2 for i in range(2, n, 2)) and counter[0] == 1:

            ans = 2 ** (n // 2)

        else:

            ans = 0

    print((ans % (10 ** 9 + 7)))

        

if __name__ == '__main__':

    main()
# -*-coding:utf-8-*-
from collections import Counter


def main():
    n = int(eval(input()))
    a_list = list(map(int, input().split()))
    counter = Counter(a_list)
    ans = 1
    if n % 2 != 0:
        for i in range(0, n, 2):
            c = counter[i]
            if (i == 0 and c != 1) or c == 0:
                print((0))
                exit()
            else:
                ans *= c
    else:
        for i in range(1, n, 2):
            c = counter[i]
            if c == 0:
                print((0))
                exit()
            else:
                ans *= c
    print((ans % (10**9 + 7)))


if __name__ == "__main__":
    main()

# -*-coding:utf-8-*-
from collections import Counter


def main():
    n = int(eval(input()))
    a_list = list(map(int, input().split()))
    counter = Counter(a_list)
    ans = 1
    if n % 2 == 0:
        if all(counter[i] == 2 for i in range(1, n, 2)):
            ans = 2 ** (n // 2)
        else:
            ans = 0
    else:
        if all(counter[i] == 2 for i in range(2, n, 2)) and counter[0] == 1:
            ans = 2 ** (n // 2)
        else:
            ans = 0
    print((ans % (10**9 + 7)))


if __name__ == "__main__":
    main()

-    if n % 2 != 0: -        for i in range(0, n, 2): -            c = counter[i] -            if (i == 0 and c != 1) or c == 0: -                print((0)) -                exit() -            else: -                ans *= c +    if n % 2 == 0: +        if all(counter[i] == 2 for i in range(1, n, 2)): +            ans = 2 ** (n // 2) +        else: +            ans = 0 -        for i in range(1, n, 2): -            c = counter[i] -            if c == 0: -                print((0)) -                exit() -            else: -                ans *= c +        if all(counter[i] == 2 for i in range(2, n, 2)) and counter[0] == 1: +            ans = 2 ** (n // 2) +        else: +            ans = 0