defmodule Main do
  def main do
    _n = IO.gets("") |> String.trim() |> String.to_integer()

    max = 1_000_000_000_000_000_000

    arr_result =
      IO.gets("")
      |> String.trim()
      |> String.split()
      |> Enum.map(&String.to_integer/1)
      |> List.foldl(1, fn x, acc -> x * acc end)

    cond do
      arr_result > max ->
        IO.puts(-1)

      true ->
        IO.puts(arr_result)
    end
  end
end