#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> iint;
typedef pair<ll,ll> llll;
#define ALL(x) (x).begin(),(x).end()
const ll zero = 0;
const ll INF = 3000000000000000000; //10^18
const int inINF = 1000000000; //10^9
const ll MOD = 1000000007; //10^9+7
const ll MOD2 = 998244353;
void Yes() {printf("Yes\n");}
void No() {printf("No\n");}
void YES() {printf("YES\n");}
void NO() {printf("NO\n");}

int main(){
    ll N;
    cin >> N;
    bool check = false;
    ll k;
    for (ll i = 1; i < 1000; i++) {
        if(i * (i+1) / 2 == N){
            check = true;
            k = i;
        }
    }
    k++;
    ll l;
    if(check){
        Yes();
        printf("%lld\n", k);
        for (ll i = 0; i < k; i++) {
            printf("%lld ", k-1);
            for (ll j = i*(i-1) / 2 + 1; j <= i*(i+1) / 2; j++) {
                printf("%lld ", j);
            }
            l = 1;
            for (ll j = i*(i+1) / 2 + i + 1; j <= N; l++) {
                printf("%lld ", j);
                j = (i+l)*((i+l)+1) / 2 + i + 1;
            }
            printf("\n");
        }
    }
    else{
        No();
    }

}