N = gets.to_i
k = Math.sqrt(2*N).floor
if k*(k+1) != 2*N
	puts 'No'
	exit
end

s, a = 0, Array.new(k+1){ [0]*k }
k.times{|i|
	(k-i).times{|j|
		a[i][j-k+i] = a[j-k+i][i] = s+=1
	}
}

puts 'Yes'
puts k+1
puts *a.map{|_|_*' '}
