let () =
  let n = Scanf.scanf "%d\n" @@ fun n -> n in
  let arr = Array.init n @@ fun _ -> Scanf.scanf "%d " @@ fun d -> d in
  let ans = Array.fold_left (fun a b -> a * b) 1 arr in
  Printf.printf "%d\n" (if ans > 1000000000000000000 then -1 else ans)