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

res = true
(n - 1).times do |i|
  if hs[i] > hs[i + 1]
    hs[i] -= 1
  end

  if hs[i] > hs[i + 1]
    res = false
    break
  end
  if i != 0 && hs[i - 1] > hs[i]
    res = false
    break
  end
end

if res == true
  puts 'Yes'
else
  puts 'No'
end