# frozen_string_literal: true

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

(n - 1).times do |i|
  diff = h[-(i + 2)] - h[-(i + 1)]
  if diff > 1
    puts :No
    exit
  elsif diff == 1
    h[-(i + 2)] -= 1
  end
end

puts :Yes