import java.util.*;
import java.io.*;
import java.lang.reflect.Array;
import java.math.BigInteger;

public class Main {
	FastScanner in;
	PrintWriter out;
	boolean systemIO = true;

	public class Pair implements Comparable<Pair> {
		int sc;
		int n;

		public Pair(int sc, int n) {
			this.sc = sc;
			this.n = n;
		}

		@Override
		public int compareTo(Pair o) {
			if (sc != o.sc) {
				return o.sc - sc;

			}
			return n - o.n;
		}

	}
	
	public class Vertex implements Comparable<Vertex> {
		int x;
		int y;
		int l;
		int r;
		int d;
		
		public Vertex(int x, int y, int l, int r) {
			this.x = x;
			this.y = y;
			this.l = l;
			this.r = r;
			d = Math.min(l, r);
		}

		@Override
		public int compareTo(Vertex o) {
			int d = Math.min(r, l);
			int od = Math.min(r, l);
			if (d != od) {
				return d - od;
			}
			if (x != o.x) {
				return x - o.x;
			}
			return y - o.y;
		}
	}
	
	public boolean check(int x, int y) {
		return x >= 0 && x < n && y >= 0 && y < m && field[x][y] && !used[x][y];
	}
	
	boolean[][] used;
	boolean[][] field;
	int n;
	int m;

	public void solve() {
		int n = in.nextInt();
		int k = 0;
		for (int i = 0; i < n + 10; i++) {
			if (i * (i - 1) / 2 == n) {
				k = i;
				break;
			}
		}
		if (k == 0) {
			out.println("No");
			return;
		}
		out.println("Yes");
		out.println(k);
		int free = 1;
		int[][] a = new int[k][k - 1];
		for (int i = 0; i < a.length; i++) {
			for (int j = 0; j < a.length; j++) {
				if (i < j) {
					a[i][j - 1] = free;
					free++;
				} else if (i > j) {
					a[i][j] = a[j][i - 1];
				}
			}
		}
		for (int i = 0; i < a.length; i++) {
			out.print(k - 1 + " ");
			for (int j = 0; j < a[i].length; j++) {
				out.print(a[i][j] + " ");
			}
			out.println();
		}
	}

	public void run() {
		try {
			if (systemIO) {
				in = new FastScanner(System.in);
				out = new PrintWriter(System.out);
			} else {
				in = new FastScanner(new File("segments.in"));
				out = new PrintWriter(new File("segments.out"));
			}
			solve();

			out.close();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	class FastScanner {
		BufferedReader br;
		StringTokenizer st;

		FastScanner(File f) {
			try {
				br = new BufferedReader(new FileReader(f));
			} catch (FileNotFoundException e) {
				e.printStackTrace();
			}
		}

		FastScanner(InputStream f) {
			br = new BufferedReader(new InputStreamReader(f));
		}

		String nextLine() {
			try {
				return br.readLine();
			} catch (IOException e) {
				return null;
			}
		}

		String next() {
			while (st == null || !st.hasMoreTokens()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(next());
		}

		long nextLong() {
			return Long.parseLong(next());
		}

		double nextDouble() {
			return Double.parseDouble(next());
		}

	}

	// AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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