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

a = 0
a = arr.shift

until arr.empty?
  b = arr.shift
  
  break if arr.empty?
  
  if a == b
    a = b
    next
  end

  if (b - a) == 1
    a = b - 1
    next
  end
  
  puts 'No'
  exit 0
end


puts 'Yes'

