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

let inf = 1_000_000_000_000_000_000L
let sorted = Array.sort(a) // benchmarking

let res =
    Array.fold (
        fun accum x ->
            if x = 0L then
                0L
            else if accum <= inf / x && accum >= 0L then
                accum * x
            else 
                -1L
        )
        1L
        sorted
 
printfn "%i" res
