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

min = Hn[0] - 1

is_ng = false
Hn.reduce do |prev, curr|
  if prev - curr > 1
    is_ng = true
    break
  end
  if curr < min
    is_ng = true
    break
  end
  curr
end

puts is_ng ? 'No' : 'Yes'
