open Batteries
let n = read_int ()
let a = read_line () |> String.split_on_char ' ' |> List.map int_of_string
let rec loop lst r=
  match lst with
  | [] -> r
  | first :: rest ->
    if first = 0 then 0 else
    loop rest (r*first)

let l = loop a 1
let _ = (if l > 1000000000000000000 || l < 0 then -1 else l) |> Printf.printf "%d\n"