let rec ( *@ ) a b = (a * b) mod 1000000007
let rec mod_pow a n =
  if n <= 0 then 1
  else if n mod 2 = 1 then a *@ mod_pow a (n-1)
  else let h = mod_pow a (n/2) in h *@ h
let () =
  let n = Scanf.scanf "%d" (fun x -> x) in
  let a = Array.init n (fun _ -> Scanf.scanf " %d" (fun x -> x)) in
  Array.sort (-) a;
  let z = n mod 2 in
  let res =
    a
    |> Array.mapi (fun i e -> (i + z) / 2 * 2 + 1 - z = e)
    |> Array.fold_left (&&) true
  in
  Printf.printf "%d\n" (if res then mod_pow 2 (n / 2) else 0)