local read = io.read
local N = read("n")
local inf = 10^18

local out = 1
for i = 1, N do
	if out < 0 then
		local preZ = read("n")
		if preZ == 0 then
			out = 0
			break
		end
	else
		out = out * read("n")
	end
	if out > inf then
		out = -1
	end
end

print(out)
