n = gets.to_i
arr = gets.split(' ').map(&:to_i)

a = nil
b = arr.pop

until arr.empty?
  a = arr.pop
  
  break if arr.empty?

  if (a - b) == 1
    a = b - 1
    next
  end
  
  if a <= b
    b = a
    next
  end

  puts 'No'
  exit 0
end


puts 'Yes'

