n=gets.strip.to_i
hh=gets.strip.split.map(&:to_i)

pre = hh.first-1

(1...n).each do |i|
  if pre > hh[i]
    puts 'No'
    exit
  end

  if pre <= hh[i]-1
    pre = hh[i]-1
  elsif pre <= hh[i]
    pre = hh[i]
  end

end

puts 'Yes'
