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

H.each_with_index do |h,i|
  if i == 0
    H[i] -= 1
    next
  end

  if h - 1 >= H[i-1]
    H[i] -= 1
  end
end

H.each_with_index do |h,i|
  break if i == N-1

  if h > H[i+1]
    puts "No"
    exit
  end
end

puts "Yes"
