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

success = true
(1..(H.size-1)).each do |i|
  if H[i] > H[i-1]
    H[i] -= 1
    next
  elsif H[i] == H[i-1]
    next
  else  # H[i] < H[i-1]
    success = false
    break
  end
end

if success
  print "Yes"
else
  print "No"
end