#include <iostream>
#include <cmath>
#include <vector>
using namespace std;

int main() {
	int N;
	cin >> N;
	int M = sqrt(N * 2);
	if ((2 * N) % M == 0 && 2 * N / M == M + 1) {
		cout << "Yes" << endl;
		cout << M + 1 << endl;
		vector<vector<int>> Ans(M + 1, vector<int>(M));
		for (int i = 0; i < M; i++) Ans[0][i] = i + 1;
		int last = M + 1;
		for (int i = 1; i < M + 1; i++) {
			for (int j = 0; j < i; j++) Ans[i][j] = Ans[j][i - 1];
			for (int j = i; j < M; j++) {
				Ans[i][j] = last;
				last++;
			}
		}
		for (int i = 0; i < M + 1; i++) {
			cout << M << " ";
			for (int j = 0; j < M; j++) cout << Ans[i][j] << (j < M - 1 ? " " : "\n");
		}
	}
	else cout << "No" << endl;

}