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

min_hight = 0
before_hight = 0
h.each do |hight|
  if before_hight <= hight
    before_hight = hight
  elsif before_hight - 1 == hight && before_hight - 1 >= min_hight
    min_hight = before_hight - 1
    before_hight = hight + 1
  else
    return puts 'No'
  end
end

puts 'Yes'