n=gets.to_i
h=gets.chomp.split(" ").map(&:to_i)
flag=true
(n-1).times do|i|
	if(h[i]>h[i+1])
		h[i]-=1
	elsif((i!=0 and h[i]<h[i-1]) or h[i]>h[i+1])
		flag=false
		break
	end
end
puts(flag ? "Yes" : "No")