stdin.ReadLine() |> ignore
stdin.ReadLine().Split(' ')
|> Array.map int64
|> Array.fold (*) 1L
|> (fun x -> if x > 1000000000000000000L then -1L else x)
|> (fun x -> if x = -1L then printfn "-1" else printfn "%d" x)