defmodule Main do
  @limit 1000000000000000000
  def main do
    _ = IO.gets("")
    a = IO.gets("")
        |> String.trim()
        |> String.split(" ")
        |> Enum.map(&String.to_integer/1)

    a
    |> Enum.sort(:asc)
    |> calc(1)
    |> case do
      x when is_integer(x) -> IO.puts(x)
      y                    -> IO.puts(y)
    end

  end

  def calc([x | _], acc) when x*acc > @limit, do: "-1"
  def calc([x | _], _) when x == 0, do: 0
  def calc([], acc), do: acc
  def calc([x | tail], acc), do: calc(tail, x*acc)

end
