let scan_int () = Scanf.scanf " %d" (fun x -> x)
let scan_array len read_func = Array.init len (fun _ -> read_func())

let () =
  let n = scan_int() in
  let h = scan_array n scan_int in
  let _ = h.(0) <- h.(0) - 1 in
  let rec for_loop i =
    if i >= n then true
    else
      if h.(i-1) > h.(i) then false
      else
        let _ = h.(i) <- max h.(i-1) (h.(i)-1) in
        for_loop (i+1) in
  if for_loop 1 then Printf.printf "Yes\n"
  else Printf.printf "No\n" 
