import sys



n, *lst = list(map(int, sys.stdin.read().split()))

lst.sort()

mod = 10 ** 9 + 7

if n % 2:

  for i in range(1, n):

    if lst[i] != (i + 1) // 2 * 2:

      print((0))

      quit()

else:

  for i in range(n):

    if lst[i] != i // 2 * 2 + 1:

      print((0))

      quit()

print(((1 << (n >> 1)) % mod))
import sys

from collections import Counter





def main():

  n, *lst = list(map(int, sys.stdin.read().split()))

  lst = sorted(Counter(lst).items())

  l = len(lst)

  mod = 10 ** 9 + 7

  if n % 2:

    for i in range(l):

      if not i:

        if lst[i][0] or lst[i][1] != 1:

          print((0))

          quit()

      elif lst[i][0] != i * 2 or lst[i][1] != 2:

        print((0))

        quit()

  else:

    for i in range(l):

      if lst[i][0] != i * 2 + 1 or lst[i][1] != 2:

        print((0))

        quit()

  print(((1 << (n >> 1)) % mod))





if __name__ == '__main__':

  main()
import sys

n, *lst = list(map(int, sys.stdin.read().split()))
lst.sort()
mod = 10**9 + 7
if n % 2:
    for i in range(1, n):
        if lst[i] != (i + 1) // 2 * 2:
            print((0))
            quit()
else:
    for i in range(n):
        if lst[i] != i // 2 * 2 + 1:
            print((0))
            quit()
print(((1 << (n >> 1)) % mod))

import sys
from collections import Counter


def main():
    n, *lst = list(map(int, sys.stdin.read().split()))
    lst = sorted(Counter(lst).items())
    l = len(lst)
    mod = 10**9 + 7
    if n % 2:
        for i in range(l):
            if not i:
                if lst[i][0] or lst[i][1] != 1:
                    print((0))
                    quit()
            elif lst[i][0] != i * 2 or lst[i][1] != 2:
                print((0))
                quit()
    else:
        for i in range(l):
            if lst[i][0] != i * 2 + 1 or lst[i][1] != 2:
                print((0))
                quit()
    print(((1 << (n >> 1)) % mod))


if __name__ == "__main__":
    main()

+from collections import Counter -n, *lst = list(map(int, sys.stdin.read().split())) -lst.sort() -mod = 10**9 + 7 -if n % 2: -    for i in range(1, n): -        if lst[i] != (i + 1) // 2 * 2: -            print((0)) -            quit() -else: -    for i in range(n): -        if lst[i] != i // 2 * 2 + 1: -            print((0)) -            quit() -print(((1 << (n >> 1)) % mod)) + +def main(): +    n, *lst = list(map(int, sys.stdin.read().split())) +    lst = sorted(Counter(lst).items()) +    l = len(lst) +    mod = 10**9 + 7 +    if n % 2: +        for i in range(l): +            if not i: +                if lst[i][0] or lst[i][1] != 1: +                    print((0)) +                    quit() +            elif lst[i][0] != i * 2 or lst[i][1] != 2: +                print((0)) +                quit() +    else: +        for i in range(l): +            if lst[i][0] != i * 2 + 1 or lst[i][1] != 2: +                print((0)) +                quit() +    print(((1 << (n >> 1)) % mod)) + + +if __name__ == "__main__": +    main()