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

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

print(out)
