N = gets.chomp.to_i
heights = gets.chomp.split(' ').map(&:to_i)

result = true
down = 0

# iとi+1を比べて高さ1以内の差ならok
heights.each_with_index.reverse_each do |h, i|
  break if i == 0
  if heights[i - 1] - (h - down) > 1
    result = false
    break
  elsif heights[i - 1] - (h - down) == 1
    # iを下げる
    down = 1
  else
    down = 0
  end
end

puts result ? "Yes\n" : "No\n"
