(*
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 () =
        (
                let ans = List.fold_right (fun a b ->
                        a * b
                ) lst 1 in
                        if ans > (Int.pow 10 18) then
                                -1
                        else
                                ans
        ) |> Printf.printf "%d\n"
