let n = Scanf.scanf " %d" (+) 0
let hs = Array.init n @@ fun _ -> Scanf.scanf " %d" (+) 0
let p = ref hs.(n - 1)
let _ = for i = n - 1 downto 0 do p := hs.(i) - if hs.(i) > !p then if hs.(i) - !p >= 2 then (print_endline "No"; exit 0) else 1 else 0 done; print_endline "Yes"