N = gets.chomp.to_i
Hn = gets.chomp.split(' ').map(&:to_i)[0...N]

top = 0
is_ng = false
Hn.reduce do |prev, curr|
  break is_ng = true if prev - curr > 1
  if prev - curr == 1
    prev -= 1
  end
  break is_ng = true if top > prev
  top = prev
  curr
end
 
puts is_ng ? 'No' : 'Yes'
