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

ans = 'Yes'
last = hs[0]

hs.each do |h|
  if last <= h
    last = h
  elsif last == h + 1
    last = h + 1
  else
    ans = 'No'
    break
  end
end

puts ans
