(*
ocamlfind ocamlopt -package batteries -linkpkg main.ml -o a.out
*)
open Batteries

let n = Scanf.sscanf (read_line ()) "%d" ( fun n -> n)

let lst = Str.split (Str.regexp " ") (read_line ())
          |> List.map int_of_string 

let rec f lst ac =
        if ac > Int.pow 10 18 then
                -1
        else
                match lst with
                          [] -> if ac > Int.pow 10 18 then
                                        -1
                                else
                                        ac
                        | first :: rest -> 
                                if ac > Int.pow 10 18 then
                                        -1
                                else
                                        f rest (ac * first)

let () =
        (
                if List.exists (fun elmnt -> elmnt = 0) lst then
                        0
                else
                        f lst 1
        ) |> Printf.printf "%d\n"
