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

result = true
down = false
# iとi+1を比べて高さ1以内の差ならok
heights.each_with_index do |h, i|
  break if i == N - 1
  if h - heights[i + 1] > 1
    result = false
    break
  elsif h - heights[i + 1] == 1
    # 前回ループでiの高さ低くしてたらだめ
    if down
      result = false
      break
    end
    # iを下げる
    down = true
  else
    down = false
  end
end

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