
import java.util.*

fun main(args: Array<String>) {
    val N = readLine()!!.toInt()
    val A = readLine()!!.split(" ").map { it.toInt() }



    var answer = 1L;
    val MOD = 1000000000L +7L
    val p = PriorityQueue(A)

    if (N % 2 == 1) {
        val head = p.poll()
        if (head != 0) {
            println(0)
            return
        }
    }
    while (!p.isEmpty()) {
        val a = p.poll()
        val b = p.poll()

        if (a != b) {
            println(0)
            return
        }
        answer = answer * 2 % MOD
    }

    println(answer)
}