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