n = io.read("*n")
t = 1
a = {}
haszero = false
for i = 1, n do
  a[i] = io.read("*n")
  if a[i] == 0 then haszero = true end
end
if haszero then
  print(0)
  os.exit()
end
for i = 1, n do
  local lim = (1000000000 * 1000000000) // t
  if lim < a[i] then
    t = -1
    break
  end
  t = t * a[i]
end
print(t)
