N = gets.to_i
Hn = gets.split.map(&:to_i)
res = 'Yes'
prev = -999

N.times do |i|
  h = Hn[i]

  if prev <= h - 1
    prev = h - 1
  elsif prev <= h
    prev = h
  else
    res = 'No'
  end
end

puts res
