object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val n = sc.nextInt()
  val a = List.fill(n)(sc.nextInt()).sorted

  val mod = 1000000007

  def plus(a: Long, b: Long): Long = (a + b) % mod
  def times(a: Long, b: Long): Long = (a * b) % mod

  def pow(a: Long, n: Int, res: Long = 1): Long = {
    if (n == 0) {
      res
    } else if ((n&1) == 0) {
      pow(times(a,a), n >> 1, res)
    } else {
      pow(times(a,a), n >> 1, times(res,a))
    }
  }

  if (n % 2 == 0) {
    val b = (1 until n by 2).flatMap(i => List(i, i))
    if (a == b) {
      println(pow(2, n/2))
    } else {
      println(0)
    }
  } else {
    val b = (0 until n by 2).flatMap(i => List(i, i)).tail
    if (a == b) {
      println(pow(2, (n-1)/2))
    } else {
      println(0)
    }
  }
}
