n = gets.chomp.to_i
arr = gets.chomp.split.map(&:to_i).reverse
(n-1).times do |i|
	if 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"