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

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 = "No"
    exit
  end
end
puts !res.nil? ? res : "Yes"