open Printf
open Scanf

let readint () = scanf " %d" (fun x -> x)

let () =
  let n = readint () in 
  let a = Array.init n (fun _ -> readint ()) in
  a.(0) <- a.(0) - 1;
  for i = 1 to n - 1 do
    if a.(i-1) < a.(i) then
      a.(i) <- a.(i) - 1
  done;
  printf "%s\n" @@ let x = Array.to_list a in if x = List.sort compare x then "Yes" else "No"

