n = gets.to_i

masu_ary = gets.split(' ').map(&:to_i)
masu_ary.each_with_index do |ima, index|
  tugi = masu_ary[index+1]
  tugi = 0 if tugi == nil
  mae = masu_ary[index-1]
  mae = 0 if index - 1 < 0
  if ima <= tugi
      next
  elsif ima-1 == tugi
      if tugi < mae
        puts 'No'
        exit
      end
      next
  end
end

puts 'Yes'