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

let bOverNum = 1000000000000000000L

/// 既定の値を超えたら true
let checkOverFlow x = x > bOverNum

let rec fb x xs =
    if List.contains 0L xs then
        0L
    else
        match xs with
        | y :: ys -> if checkOverFlow (x * y) 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"