#include <iostream>
#include <cmath>

using namespace std;

int main() {
  int N; cin >> N;
  int k = (1 + sqrt(1 + 8 * N)) / 2;
  if (2 * N != k * (k - 1)) {
    cout << "No" << endl;
    return 0;
  }
  cout << "Yes" << endl;
  cout << k << endl;
  cout << k - 1;
  for (int i = N - k + 2; i <= N; i++) cout << " " << i;
  cout << endl;

  for (int i = 1; i < k; i++) {
    cout << k - 1;
    int j = i * (i - 1) / 2 + 1;
    int l = i;
    bool downward = true;
    while (j != (k - i) * (k - i + 1) / 2) {
      cout << " " << j;
      if (j >= N - k + 2 && j <= N) downward = false;
      if (downward) {
        j += l + 1;
        l++;
      } else {
        j -= l - 1;
        l--;
      }
    }
    cout << " " << j << endl;
  }
}