# frozen_string_literal: true

n = gets.to_i
h = gets.split(' ').map(&:to_i)

res = 'No'

def possible?(ha, na)
  (na-1).times do |i|
    gap = ha[i] - ha[i + 1]
    return false if gap > 1
    ha[i + 1] += 1 if gap == 1
  end
  true
end

res = 'Yes' if possible?(h, n)

puts res