# https://atcoder.jp/contests/abc136/tasks/abc136_c

N = gets.to_i
Hs = gets.split.map(&:to_i)

cond = true
(N - 2).downto(0) do |i|
  d = Hs[i + 1] - Hs[i]
  cond = false if d < -1
  Hs[i] -= 1 if d == -1
end

puts cond ? 'Yes' : 'No'
