N = gets.to_i
H = gets.split.map(&:to_i)
result = true

H[0] -= 1
(1...N).each do |i|
  if H[i-1] > H[i]
    result = false
    break
  elsif H[i-1] < H[i]
    H[i] -= 1
  end
end

puts result ? 'Yes' : 'No'