# ARC066C - Lining Up (ABC050C)

from collections import Counter





def main():

    n = int(eval(input()))

    a = sorted(Counter(list(map(int, input().rstrip().split()))).items())

    MOD = 10 ** 9 + 7

    if n % 2 == 1 and a[0][1] != 1:

        print((0))

    elif not all(i[1] == 2 for i in a[1:]):

        print((0))

    else:

        if n % 2 == 0:

            print((2 ** len(a) % MOD))

        else:

            print((2 ** (len(a) - 1) % MOD))





if __name__ == "__main__":

    main()
# ARC066C - Lining Up (ABC050C)

from collections import Counter





def main():

    n = int(eval(input()))

    a = tuple(map(int, input().rstrip().split()))

    MOD = 10 ** 9 + 7

    s = (n // 2) * 2

    l = (n + 1) // 2

    p = l if n % 2 == 0 else l - 1

    if sum(a) == s * l:

        print((2 ** p % MOD))

    else:

        print((0))





if __name__ == "__main__":

    main()
# ARC066C - Lining Up (ABC050C)
from collections import Counter


def main():
    n = int(eval(input()))
    a = sorted(Counter(list(map(int, input().rstrip().split()))).items())
    MOD = 10**9 + 7
    if n % 2 == 1 and a[0][1] != 1:
        print((0))
    elif not all(i[1] == 2 for i in a[1:]):
        print((0))
    else:
        if n % 2 == 0:
            print((2 ** len(a) % MOD))
        else:
            print((2 ** (len(a) - 1) % MOD))


if __name__ == "__main__":
    main()

# ARC066C - Lining Up (ABC050C)
from collections import Counter


def main():
    n = int(eval(input()))
    a = tuple(map(int, input().rstrip().split()))
    MOD = 10**9 + 7
    s = (n // 2) * 2
    l = (n + 1) // 2
    p = l if n % 2 == 0 else l - 1
    if sum(a) == s * l:
        print((2**p % MOD))
    else:
        print((0))


if __name__ == "__main__":
    main()

-    a = sorted(Counter(list(map(int, input().rstrip().split()))).items()) +    a = tuple(map(int, input().rstrip().split())) -    if n % 2 == 1 and a[0][1] != 1: +    s = (n // 2) * 2 +    l = (n + 1) // 2 +    p = l if n % 2 == 0 else l - 1 +    if sum(a) == s * l: +        print((2**p % MOD)) +    else: -    elif not all(i[1] == 2 for i in a[1:]): -        print((0)) -    else: -        if n % 2 == 0: -            print((2 ** len(a) % MOD)) -        else: -            print((2 ** (len(a) - 1) % MOD))