open Batteries
let n = read_int ()
let a = read_line () |> String.split_on_char ' ' |> List.map int_of_string |> List.fold_left (fun a b -> a * b) 1
let _ = (if a > 1000000000000000000 then -1 else a) |> Printf.printf "%d\n"