fun intList() = readLine()?.split(" ")?.map(String::toInt) ?: TODO()
fun main(args: Array<String>) {
    val n = readLine()?.toInt() ?: return
    val a = intList()
    val m = (1e9 + 7).toLong()
    val map = hashMapOf<Int, Int>()
    a.forEach {
        map[it] = map.getOrDefault(it, 0) + 1
    }
    val zero = map.getOrDefault(0, 0)
    if (n % 2 == 1 && zero != 1) {
        println("0")
        return
    } else if (n % 2 == 0 && zero != 0) {
        println("0")
        return
    }
    map.remove(0)
    var t = 1L
    map.values.forEach {
        if (it != 2) {
            println("0")
            return
        } else {
            t = t * 2 % m
        }
    }
    println(t.toString())
}