n = gets.to_i
h = gets.split.map(&:to_i)

h.each do |value, index|
  if index < h.length
    difference = value - h[index + 1]
    if difference > 1 
      puts 'No'
      exit
    else
      value = value - 1
    end
  end
end

puts 'Yes'