let N = Int(readLine()!)!
if (readLine()!.characters.split(" ").map{Int(String($0))!}.sort()) == ((0..<N).map{$0+($0+N+1)%2}) {
    print((0..<N/2).reduce(1){i,_ in i*2%1000000007})
} else {
    print(0)
}