import std;
import core.bitop;

// dfmt off
ulong MAX = 100_100, MOD = 1_000_000_007, INF = 1_000_000_000_000;
alias sread = () => readln.chomp();
alias lread(T = long) = () => readln.chomp.to!(T);
alias aryread(T = long) = () => readln.split.to!(T[]);
void aryWrite(T = long)(T[] ary){ ary.map!(x => x.text()).join(' ').writeln(); }
alias Pair = Tuple!(long, "H", long, "W", long, "cost");
alias PQueue(T, alias less = "a>b") = BinaryHeap!(Array!T, less);
// dfmt on

void main()
{
    auto n = lread();
    long k;
    while (k * (k - 1) / 2 < n)
        k++;

    if (n != (k * (k - 1) / 2))
    {
        writeln("No");
        return;
    }
    else
    {
        writeln("Yes");
        writeln(k);
    }

    auto a = new long[][](k, 0);
    long cur = 1, idx;
    while (cur <= n)
    {
        auto next = cur + (k - 1) - a[idx].length;
        auto j = iota(cur, next).array();
        // j.writeln();
        a[idx] ~= j;
        foreach (i; iota(idx + 1, k))
        {
            a[i] ~= j[i - (idx + 1)];
        }
        cur = next;
        idx++;
        // cur.writeln();
    }
    foreach (e; a)
    {
        writef("%s ", e.length);
        e.aryWrite();
    }
}

void scan(TList...)(ref TList Args)
{
    auto line = readln.split();
    foreach (i, T; TList)
    {
        T val = line[i].to!(T);
        Args[i] = val;
    }
}
