inputs = Array.new
while line = $stdin.gets
  inputs << line.chomp
end
N = inputs[0].to_i
H = inputs[1].split(" ").map(&:to_i)

max = nil
ans = true

i = 0;
while i < N && ans
  h = H[i]
  if max.nil? || max < h
    max = h
  elsif max - h >= 2
    ans = false
  end
  i += 1
end

puts ans ? "Yes" : "No"