#include <bits/stdc++.h>
#define loop2(i, s, n, a) for (int i = int(s); i < int(n); i += a)
#define loop(i, s, n) loop2(i, s, n, 1)
#define rep(i, n) loop(i, 0, n)

#define pb push_back
#define all(in) in.begin(),in.end()

using ll = long long;
using ull = unsigned long long;
using namespace std;

int main(){
    int n; cin >> n;
    int k = 0; while(k*(k-1)/2 < n) k++;
    if(k*(k-1)/2 > n){ cout << "No" << endl; return 0;}
    cout << "Yes" << endl;
    cout << k << endl;
    int ans[k][k-1];
    int count = 1;
    rep(i,k) rep(j,k-1){
        if(i <= j){
            ans[i][j] = count;
            ans[j+1][i] = count;
            count++;
        }
    }
    rep(i,k) rep(j,k-1){
        if(j == 0) cout << k-1 << " ";
        cout << ans[i][j] << " ";
        if(j == k-2) cout << endl;
    }
    return 0;
}