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

ans = 'Yes'

last = hs[0]
hs.each do |h|
  if h < last
    h -= 1 if h == last + 1
    if h < last
      ans = 'No'
      break
    end
  end

  last = h
end

puts ans
