from collections import Counter

def main():

    mod = 10**9+7

    n = int(eval(input()))

    a = list(map(int,input().split(' ')))

    c = Counter(a)

    ans = 1

    if n%2 != 0:

        for key,i in list(c.items()):

            if key%2 != 0 or (key==0 and i != 1) or (key != 0 and i != 2):

                ans = 0

                break

            elif i ==2:

                ans *=2

                ans %= mod

    else:

        for key,i in list(c.items()):

            if key%2 ==0 or i !=2:

                ans = 0

                break

            elif i ==2:

                ans *=2

                ans %= mod

    print(ans)

if __name__ == '__main__':

    main()
from collections import Counter

def main():

    mod = 10**9+7

    n = int(eval(input()))

    a = list(map(int,input().split(' ')))

    c = Counter(a)

    ans = (2**(n//2))%mod

    if n%2 != 0:

        for key,i in list(c.items()):

            if key%2 != 0 or (key==0 and i != 1) or (key != 0 and i != 2):

                ans = 0

                break

    else:

        for key,i in list(c.items()):

            if key%2 ==0 or i !=2:

                ans = 0

                break



    print(ans)

if __name__ == '__main__':

    main()
from collections import Counter


def main():
    mod = 10**9 + 7
    n = int(eval(input()))
    a = list(map(int, input().split(" ")))
    c = Counter(a)
    ans = 1
    if n % 2 != 0:
        for key, i in list(c.items()):
            if key % 2 != 0 or (key == 0 and i != 1) or (key != 0 and i != 2):
                ans = 0
                break
            elif i == 2:
                ans *= 2
                ans %= mod
    else:
        for key, i in list(c.items()):
            if key % 2 == 0 or i != 2:
                ans = 0
                break
            elif i == 2:
                ans *= 2
                ans %= mod
    print(ans)


if __name__ == "__main__":
    main()

from collections import Counter


def main():
    mod = 10**9 + 7
    n = int(eval(input()))
    a = list(map(int, input().split(" ")))
    c = Counter(a)
    ans = (2 ** (n // 2)) % mod
    if n % 2 != 0:
        for key, i in list(c.items()):
            if key % 2 != 0 or (key == 0 and i != 1) or (key != 0 and i != 2):
                ans = 0
                break
    else:
        for key, i in list(c.items()):
            if key % 2 == 0 or i != 2:
                ans = 0
                break
    print(ans)


if __name__ == "__main__":
    main()

-    ans = 1 +    ans = (2 ** (n // 2)) % mod -            elif i == 2: -                ans *= 2 -                ans %= mod -            elif i == 2: -                ans *= 2 -                ans %= mod