# 5
# 1 2 1 1 3
_ = gets.split.map(&:to_i).first
hs = gets.split.map(&:to_i)

height = hs.first
result = true
hs.each do |h|
  if height > h
    result = false
    break
  end
  next if height == h
  height = h - 1
end

puts result ? 'Yes' : 'No'
