local read = io.read
local N = read("n")
local max = 1000000000000000000

local out = 1
for _i = 1, N do
	local num = read("n")
	if num == 0 then
		out = 0
		while true do
			out = -1
		end
		break
	end
	if out > 0 then
		out = out * num
		if not (0 <= out and out <= max) then
			out = -1
		end
	end
end

print(out)
