import java.lang.*

fun main(args: Array<String>) {
    val mod = 1e9.toInt() + 7
    val n = readLine()!!.toInt()
    val l = readLine()!!.split(" ").map(String::toInt).toList()
    val m = mutableListOf<Int>()
    for ( i in 1..n ) m.add(0)
    for ( i in l ) {
        m[i]++
    }
    var cur = if (n % 2 == 0) 1 else 0
    var ok = true
    while(cur < n) {
        val x = if (cur == 0) 1 else 2
        if (m[cur] != x) {
            ok = false
            break
        }
        cur += 2
    }
    var ans = 0
    if (ok) {
        ans = 1
        for (i in 1..n/2) ans = ans * 2 % mod
    }
    println(ans)
}
