Scanf.scanf "%d" (fun n ->
    let a = Array.init n (fun _ -> Scanf.scanf " %d" (fun a -> a)) in
    Array.sort compare a;
    let f = n mod 2 in
    let rec loop i =
        if i = n then true else (
            if f = 0 then (
                if i / 2 * 2 + 1 = a.(i) then loop (i + 1) else false
            ) else (
                if (i + 1) / 2 * 2 = a.(i) then loop (i + 1) else false
            )
        )
    in
    let z = 1_000_000_007 in
    let ( *@) a b = (a * b) mod z in
    let powmod a b =
        let rec loop r i acc =
            if i = 0 then acc else loop (r *@ r) (i lsr 1) (if i land 1 = 1 then acc *@ r else acc)
        in
        loop a b 1
    in
    Printf.printf "%d\n" @@ if loop 0 then powmod 2 ((n - f) lsr 1) else 0
)