let n = int (stdin.ReadLine())
let h = stdin.ReadLine().Split() |> Array.map int64
let mutable ans = "Yes"
for i in 1..n - 1 do
     let sa = h.[i] - h.[i - 1] 
     if sa > 0L then h.[i] <- h.[i] - 1L
     elif sa < 0L then ans <- "No"
printfn "%s" ans