var toInt = x=>parseInt(x,10);
var toIntArr = arr=>arr.map(x=>toInt(x));
var abs = x=>x>0?x:-x;
function min(){var rest=arguments,v=rest[0];for(var i=1;i<rest.length;i++)if(rest[i]<v)v=rest[i];return v}
function max(){var rest=arguments,v=rest[0];for(var i=1;i<rest.length;i++)if(rest[i]>v)v=rest[i];return v}
function gcd(){var rest=arguments,v=rest[0],temp=(a,b)=>b?temp(b,a%b):a;for(var i=1;i<rest.length;i++)v=temp(v,rest[i]);return v}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
 
function Main(input){
	var input = input.split('\n');
	var n = toInt(input[0]);
	var m = 0;

	for(var i = 1; i <= n; i++){
		if(n === i*(i-1)/2){
			m = i;
		}
	}

	if(m===0){
		console.log('No');
		return 0;
	}

	console.log('Yes');
	console.log(m);

	var ss = [];
	var l = 0;
	for(var i = 0; i < m; i++){
		ss[i] = [];
	}
	for(var i = 0; i < m; i++){
		for(var j = i+1; j < m; j++){
			l++;
			ss[i].push(l);
			ss[j].push(l);
		}
	}

	var ans = '';
	for(var i = 0; i < m; i++){
		ans = '';
		ans += ss[i].join(' ');
		ans += ss[i].length.toString(10);
		console.log(ans);
	}

	return 0;
}

