open Printf
open Scanf

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

let is_sorted a = 
  let ans = ref true in
  for i = 0 to Array.length a - 2 do
    if a.(i) > a.(i+1) then ans := false
  done;
  !ans

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" @@ if is_sorted a then "Yes" else "No"

