local n=io.read("n")
local answer=1
local length=0
for i=1,n do
    a=io.read("n")
    length=length+math.log(a,10)
    answer=answer*a
end
if length>18 or answer>10^18 then
    print(-1)
else
    print(answer)
end    