let () =
  let n = Scanf.scanf "%d\n" @@ fun n -> n in
  let ans = ref 1 in
  for i = 1 to n do
    Scanf.scanf "%d " @@ fun x ->
    ans := !ans * x;
  done;
  Printf.printf "%d\n" (if !ans > 1000000000000000000 then -1 else !ans)