#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> pll;

int main() {
  ll n;
  cin >> n;
  for(ll i=2;i*(i-1)/2<=n;i++) {
    if(i*(i-1)/2==n) {
      cout << "Yes" << endl;
      cout << i << endl;
      vector<vector<ll>> a(i-1,vector<ll>(i-1));
      ll temp=1;
      for(ll j=0;j<i-1;j++) {
        for(ll k=0;k<j+1;k++) {
          a[j][k]=temp;
          a[k][j]=temp;
          temp++;
        }
      }
      for(ll j=0;j<i-1;j++) {
        cout << i-1 << " ";
        for(ll k=0;k<i-1;k++) {
          cout << a[j][k] << " ";
        }
        cout << endl;
      }
      cout << i-1 << " ";
      for(ll j=0;j<i-1;j++) {
        cout << a[j][j] << " ";
      }
      cout << endl;
      return 0;
    }
  }
  cout<< "No" << endl;
}