local function reada(n,m)m=m or 1 r={}for i=1,m do r[i]={}end for i=1,n do for j=1,m do r[j][i]=io.read"*n"end end return unpack(r)end
N=io.read"*n"
H=reada(N)
for i=1,N-1 do
	if(H[i]-H[i+1]<1)then
		H[i]=H[i]-1
	end
end
for i=1,N-1 do
	if(H[i]-H[i+1]>0)then print"No"return end
end
print"Yes"