let n = read_int ()
let cs = Array.make n 0
let f n = Printf.printf "%d\n" n; exit 0
let ( * ) a b = a * b mod 1000000007
let rec g b n = if n <= 0 then 1 else let p = g b (n / 2) in p * p * if n mod 2 = 0 then 1 else b
let _ = for _ = 1 to n do Scanf.scanf " %d" @@ fun a -> if n mod 2 = a mod 2 then f 0; cs.(a) <- cs.(a) + 1 done; if cs.(0) <> n mod 2 then f 0; for i = 1 to n / 2 do if cs.(2 * i - (1 - n mod 2)) <> 2 then f 0 done; Printf.printf "%d\n" @@ g 2 (n / 2)