N = gets.chomp.to_i
arr = gets.split.map(&:to_i).reverse
arr.each_with_index do |n, i|
  next if i == 0
  next if i == 1 and arr[1] <= arr[0] + 1
  next if arr[i] <= arr[i-1] + 1 and arr[i] <= arr[i-2] + 1
  puts 'No'
  exit
end
puts 'Yes'