let n = (stdin.ReadLine >> int) ()
let hs = stdin.ReadLine().Split(' ') |> Array.map int

let mutable cash = hs.[0]
let mutable result = true
for h in hs do
    if cash <= h-1 then
        cash <- h-1
    elif cash = h then
        cash <- h
    else
        result <- false
if result then
    printfn "Yes"
else
    printfn "No"