let readIntArray () =
    stdin.ReadLine().Split(" ") |> Array.map int64

readIntArray ()

readIntArray ()
|> Array.reduce (fun x y -> if y <= -1L || y > 1000000000000000000L then -1L else x * y)
|> fun x -> if x > 1000000000000000000L then -1L else x
|> printfn "%d"
