fun main(args: Array<String>) {
    val mod = 1000000007L
    
    val N = readInputLine().toInt()
    val A = readInputLine().split(" ").map { it.toInt() }.sorted()

    var now = 0
    var cnt = 0

    if (N % 2 == 1) {
        now = 0
        cnt = 1
    } else {
        now = 1
        cnt = 0
    }
    
    for (a in A) {
        if (a != now) {
            if (cnt != 2) {
                println(0)
                return
            }
            now = a
            cnt = 1
        } else {
            cnt++
        }
    }
    
    if (cnt != 2) {
        println(0)
        return
    }
    
    var ans = 1L
    
    for (i in 1..N / 2) {
        ans *= 2L
        ans %= mod
    }
    
    println(ans)
}

fun readInputLine(): String {
    return readLine()!!
}

