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

max_num = 0
result = "Yes"
n.times do |index|
  if index == 0
    max_num = h[index]
    next
  end

  if max_num - 1 <= h[index]
    max_num = [max_num, h[index]].max
  else
    result = "No"
    break
  end
end

puts result