let inf = 1_000_000_000_000_000_000L

let n = int64(stdin.ReadLine())
let a = stdin.ReadLine().Split() |> Array.map(int64)

for x in a do
    if x = 0L then
        printfn "0"
        exit(0)

let mutable accum = 1L

for x in a do
    if accum <= inf / x then
        accum <- accum * x
    else
        printfn "-1"
        exit(0)

printfn "%i" accum
