#light "off"
open System;;
open System.IO;;

let reader = new StreamReader(new BufferedStream(Console.OpenStandardInput ()))
let writer = new StreamWriter(new BufferedStream(Console.OpenStandardOutput ()))

let skipSpaces () = while reader.Peek () <= int ' ' do reader.Read () |> ignore done;;
let read f = skipSpaces (); [|while reader.Peek () > int ' ' do yield char (reader.Read ()) done |] |> System.String |> f;;
let readint () = skipSpaces (); let mutable ans = 0 in while reader.Peek () > int ' ' do ans <- ans * 10 + (reader.Read () - int '0'); done; ans;;
let write (s : string) = writer.Write s;;
let writeln (s : string) = writer.WriteLine s;;

let N = readint ();;
let A = Array.init N (fun _ -> readint ());;

A.[0] <- A.[0] - 1;;
let mutable ans = true;;

for i in 1..N-1 do
  if A.[i-1] > A.[i] then
    ans <- false
  elif A.[i-1] < A.[i] then
    A.[i] <- A.[i] - 1
done;;

(if ans then "Yes" else "No") |> printfn "%s";;

reader.Close();;
writer.Close();;