let checkOverFlow (x: int64) (y: int64) = x > 1000000000000000000L / y

let rec fb (x: int64) (xs: int64 list) =
    match xs with
    | y :: ys -> if checkOverFlow x y then -1L else fb (x * y) ys
    | [] -> x

stdin.ReadLine() |> ignore
let b = stdin.ReadLine().Split(' ') |> Array.map int64
if Array.contains 0L b
then printfn "0"
else b |> List.ofArray |> fb 1L |> printfn "%d"
