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

    a=IO.gets("") |> String.trim |> String.split(" ") |>Enum.map(fn x->String.to_integer(x)end)
    Enum.reduce(a, 1, fn (x, acc)-> if (x*acc>m) || (acc*x<0) do 
        acc=-1
      else
        x*acc
      end
      end)
      |> IO.puts()
  end
end
