let b0 = stdin.ReadLine() |> ignore
let b = stdin.ReadLine().Split(' ')

/// 既定の値を超えたら true
let checkOverFlow x =
    if x > 1000000000000000000L then true else false

let rec fb x xs = //: int64 -> int64 list -> int64 =
    match xs with
    | y :: ys -> if checkOverFlow x then -1L else fb (x * y) ys
    | [] -> if checkOverFlow x then -1L else x
b
|> (fun x -> x |> Array.map int64 |> List.ofArray |> fb 1L)
|> printfn "%d"