n = gets.to_i
h = gets.split(' ').map(&:to_i)
flag = 0
(n-1).times do |i|
	h[i] -= 1 if h[i] > h[i+1]
end

(n-1).times do |j|
	if h[j] > h[j+1]
		flag = 1
		break
	end
end

if flag == 0
	puts 'Yes'
else
	puts 'No'
end

