n = gets.chomp.to_i
arr = gets.chomp.split.map(&:to_i)
(n-1).times do |i|
	if arr[i] >= arr[i + 1] + 2
		puts "No"
		exit
	elsif arr[i] == arr[i + 1] + 1
		arr[i] -= 1
	end
end

(n-1).times do |i|
	if arr[i] > arr[i+1]
		puts "No"
		exit
	end
end
puts "Yes"


