n = gets.to_i
hs = gets.split.map &:to_i

is_ok = true

(0 .. hs.size - 2).each{ |i|
	if hs[i] == hs[i+1] + 1 then
		hs[i] = hs[i] - 1
	end
}

(0 .. hs.size - 2).each{ |i|
	if hs[i] > hs[i+1] then
		is_ok = false
	end
}

if is_ok then
	puts 'Yes'
else
	puts 'No'
end
