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