local n=io.read("n")
local a={}
local zero=false
for i=1,n do
    a[i]=io.read("n")
    if a[i]==0 then
        zero=true
    end
end
if zero then
    print(0)
else
    local answer=1
    for i=1,n do
        answer=answer*a[i]
        if answer>10^18 then
            print(-1)
            return
        end
    end
    print(string.format("%d",answer))
end
