import java.util
import java.util.Scanner

object Main {
  val MOD = 1000000007

  def solve(N: Int, A: Array[Int]): Int = {
    util.Arrays.sort(A)

    if (N % 2 == 1) {
      def testExpected(i: Int): Boolean = {
        val expected = if (i == 0) 0 else (i + 1) / 2 * 2
        A(i) == expected
      }
      if (A.indices.forall(testExpected)) pow_mod(2, (N - 1) / 2, MOD) else 0
    } else {
      def testExpected(i: Int): Boolean = {
        val expected = i / 2 * 2 + 1
        A(i) == expected
      }
      if (A.indices.forall(testExpected)) pow_mod(2, N / 2, MOD) else 0
    }
  }

  def main(args: Array[String]): Unit = {
    val sc = new Scanner(System.in)
    val N = sc.nextInt()
    val A = Array.ofDim[Int](N)
    A.indices foreach (i => A(i) = sc.nextInt())
    println(solve(N, A))
  }

  /**
    *
    * 7 = (2 * 3) + 1 = (2 * (2 + 1)) + 1
    *
    */
  def pow_mod(x: Int, n: Int, m: Int): Int = n match {
    case 0 => 1
    case _ =>
      val r = pow_mod(x * x % m, n / 2, m)
      if (n % 2 == 1) r * x % m else r
  }
}
