n = gets.to_i
*h = gets.split.map(&:to_i).reverse

i = 0
while i < n - 1
  i+=1
  if h[i-1] <= h[i]
    next
  elsif h[i-1] - 1 <= h[i]
    next
  else
    res = true
    break
  end
end

puts res ? "No" : "Yes"