n = gets.to_i
hs = gets.chomp.split.map(&:to_i)

cur_h = hs[0]
flag = true
hs.each do |h|
  if h >= cur_h
    cur_h = h - 1 if cur_h < h - 1
  else
    flag = false
  end
end

puts flag ? "Yes" : "No"