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

    arr =
      IO.gets("")
      |> String.trim()
      |> String.split()
      |> Enum.map(&String.to_integer/1)

    case Enum.find(arr, fn x -> x == 0 end) do
      0 ->
        IO.puts(0)

      nil ->
        Main.list_multi(arr, 1)
    end
  end

  def list_multi([first | []], acc) do
    if acc * first <= 1_000_000_000_000_000_000 do
      IO.puts(acc * first)
    else
      IO.puts(-1)
    end
  end

  def list_multi([first | rest], acc) do
    if acc > 1_000_000_000_000_000_000 do
      IO.puts(-1)
    else
      new_acc = acc * first
      list_multi(rest, new_acc)
    end
  end
end