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