Felix6326727/beyond-accuracy-code-comprehension huggingface dataset:
N = int(input())

K = -1
for k in range(N+1):
    if k*(k-1)//2 == N:
        K = k
        break
    elif k*(k-1)//2 > N:
        break

if N == 1:
    print('Yes')
    print(2)
    print(1, 1)
    print(1, 1)
elif K == -1:
    print('No')
else:
    print('Yes')
    print(K)
    n = 0
    S = [[] for _ in range(K)]
    for i in range(K):
        for j in range(i+1, K):
            n += 1
            S[i].append(n)
            S[j].append(n)
    for s in S:
        print(len(s), ' '.join([str(a) for a in s]))

# Example run
# Input:
1049999
# Output:
No
n=int(input())
nn=int((n*2)**0.5)
if n*2!=nn*(nn+1):
  print("No")
else:
  print("Yes")
  print(nn+1)
  Ans=[[0]*nn for _ in range(nn+1)]
  for i in range(nn):
    for j in range(nn-i):
      Ans[i][i+j]+=nn*i-i*(i-1)//2+j+1
      Ans[i+j+1][i]+=nn*i-i*(i-1)//2+j+1
  for a in Ans:
    print(nn,*a)

# Example run
# Input:
1
# Output:
Yes
2
1 1
1 1
def main():
    n=int(input())
    a=1
    m=int((2*n)**0.5)
    if m*(m+1)==n*2:
        a=m+1
        print("Yes")
    else:
        print("No")
        exit()
    print(a)
    s=set(range(1,1+n))
    l=[0]*(n+1)
    ans=[set()]

    for i in range(a):
        ll=set()
        for j in ans[:i+1]:
            for p in s&j:
                if p not in ll:
                    ll.add(p)
                    if l[p]==1:
                        s.remove(p)
                    else:
                        l[p]+=1
                    break

        for p in s:
            if len(ll)>=n*2//a:
                break
            else:
                if l[p]==0:
                    ll.add(p)
                    l[p]+=1

        ans.append(ll)
    for i in ans[1:]:
        print(n*2//a,*i)


if __name__ == '__main__':
    main()








# Example run
# Input:
11609
# Output:
No
n = int(input())
k = int((n*2)**(1/2))-1
for i in range(10):
    if (k+i)*(k+i-1)==n*2:
        k+=i
        break
if k*(k-1)!=n*2:
    print("No")
    exit()
print("Yes")
print(k)
tri = []

for i in range(1,k):
    tri.append([j for j in range(i*(i-1)//2+1,i*(i+1)//2+1)])
for i in range(k-1):
    print(k-1,end = " ")
    print(*tri[i],end=" ")
    for j in range(i+1,k-1):
        print(tri[j][i],end=" ")
    print()
print(k-1,end=" ")    
for i in range(k-1):
    print(tri[i][-1],end = " ")



# Example run
# Input:
3615919
# Output:
No
n=int(input())
if n==3:
    print("2 1 2\n2 3 1\n2 2 3")
else:
    print("No")

# Example run
# Input:
224
# Output:
No
def main():
    #部分集合のサイズnの時n+1個の部分集合
    n=int(input())
    if 2*n!=int((2*n)**0.5)*(int((2*n)**0.5)+1):
        print("No")
        exit()
    print("Yes")
    l=int((2*n)**0.5)
    print(l)
    work=[[] for _ in range(l+1)]
    now_sub=0
    next_sub=1
    for i in range(1,n+1):
        if len(work[now_sub])==l:
            now_sub+=1
            next_sub=now_sub+1
        work[now_sub].append(i)
        work[next_sub].append(i)
        next_sub+=1
    
    for i in range(l+1):
        print("{} {}".format(l+1," ".join(map(str,work[i]))))

main()


# Example run
# Input:
65444
# Output:
No
n = int(input())

ok = False
x = 0

for i in range(1000):
    if n == i * (i + 1) // 2:
        ok = True
        x = i
        break

if ok:
    print('Yes')
    d = n * 2 // x
    print(d)

    a = [[] for _ in range(d)]
    a[0].append(1)
    a[1].append(1)

    now = 1
    for i in range(2, d):
        for j in range(i):
            a[j].append(now + j + 1)
        for j in range(i):
            a[i].append(now + j + 1)
        now += i

    for i in range(d):
        print(x, *a[i])
else:
    print('No')


# Example run
# Input:
591
# Output:
No
n = int(input())
for k in range(2,n + 1):
    if k * (k - 1) // 2 == n:
        print("Yes")
        break
    if k * (k - 1) // 2 > n:
        print("No")
        exit()

print(k)
answer = [[] for _ in range(k)]

num = [[i,j] for i in range(k) for j in range(i+1,k)]

for i,st in enumerate(num):
    s,t = st
    answer[s].append(i + 1)
    answer[t].append(i + 1)

for ans in answer:
    print(k-1,*ans)


# Example run
# Input:
870
# Output:
No
import math
n = int(input())
if n == 1:
    print("Yes")
    print(1)
    print("1 1")
    exit()

ok = False
for i in range(2, int(math.sqrt(n*2)+1)):
    if n*2 % i == 0 and n*2 // i == i+1:
        ok = True
        size = i
        break
if ok:
    ans = [[0] * size for _ in range(size+1)]
    val = 1
    for i in range(0, size+1):
        for j in range(i, size):
            ans[i][j] = val
            val += 1
    val = 1
    for i in range(0, size):
        for j in range(i, size):
            ans[1+j][i] = val
            val += 1
    print("Yes")
    print(size+1)
    for line in ans:
        print(str(size) + " " + " ".join([str(item) for item in line]))

else:
    print("No")

# Example run
# Input:
103303
# Output:
No
def main():
    N = int(input())
    # N=1: {1}, {1} (1*2)
    # N=3: {1, 2}, {1, 3}, {2, 3} (2*3)
    # N=6: {1, 2, 3}, {1, 4, 5}, {2, 4, 6}, {3, 5, 6} (3*4)
    # N=10:{1, 2, 3, 4}, {1, 5, 6, 7}, {2, 5, 8, 9}, {3, 6, 9, 10}, {4, 7, 8, 10} (4*5)
    # N=n(n+1)/2のケース(n=1,2,...)で構成可能
    # 集合の数はn+1で要素数はn
    n = 1
    while n * (n + 1) < 2 * N:
        n += 1
    if n * (n + 1) != 2 * N:
        print('No')
        return
    ans = [list() for _ in range(n + 1)]
    num = 0
    for left in range(n):
        for right in range(left + 1, n + 1):
            num += 1
            ans[left].append(num)
            ans[right].append(num)
    print('Yes')
    for li in ans:
        print('{} {}'.format(len(li), ' '.join(map(str, li))))


if __name__ == '__main__':
    main()


# Example run
# Input:
7987516
# Output:
No
N = int(input())

tmp = 0
flag = True
for k in range(N):
    tmp += k
    if tmp == N:
        break
    if tmp > N:
        flag =False
        break

if not flag:
    print ('No')
    exit()

G = [[] for _ in range(k + 1)]

count = 1
flag = False
for i in range(k):
    for j in range(i + 1, k + 1):
        G[i].append(count)
        G[j].append(count)
        count += 1

print ('Yes')
print (k + 1)
for tmp in G:
    print (len(tmp), *tmp, sep = ' ')

# Example run
# Input:
35197
# Output:
No
def solve(n):
    k= -1
    for i in range(1000):
        if i * (i-1) == 2 * n:
            k =i
            print("Yes")
            break
        elif i*(i-1)  > 2*n:
            print("No")
            return
    ans = [[-1 for i in range(k-1)] for i in range(k)]
    c = 1
    print(k)
    for i in range(k):
        for j in range(k-i-1):
            ans[i][i+j] = c
            ans[i+j+1][i] = c
            c += 1

    for i in range(k):
        print(k-1 ,end = "")
        for j in ans[i]:
            print(" " + str(j),end = "")
        print()

solve(int(input()))
    
        




# Example run
# Input:
-213058
# Output:
No
N=int(input())
if N%3>0:
    if N<9:
        print('No')
    y=-1
    for i in range(3,N):
        if N%i==0:y=i
    if y<3:print('No')
    else:
        X=[]
        print('Yes')
        M=N//y
        for i in range(y):
            X.append([(x-1)%N+1 for x in range(1+M*i,2+M+M*i)])
        for i in range(M-1):
            X.append([X[j][i+1] for j in range(y)])
        
        def enstr(x):
            s=''
            for i in x:
                s+=(str(i)+' ')
            return s

        print(len(X))
        for i in X:
            print(len(i),enstr(i))
else:
    X=[]
    print('Yes')
    M=N//3
    for i in range(3):
        X.append([(x-1)%N+1 for x in range(1+M*i,2+M+M*i)])
    for i in range(M-1):
        X.append([X[j][i+1] for j in range(3)])

    def enstr(x):
        s=''
        for i in x:
            s+=(str(i)+' ')
        return s

    print(len(X))
    for i in X:
        print(len(i),enstr(i))

# Example run
# Input:
-1836
# Output:
Yes
3
0 
0 
0
n = int(input())
k = (2*n+0.25)**(1/2)+1/2
if k-int(k) == 0:
    print("Yes")
    k = int(k)
    print(k)
    bset = [[] for i in range(k)]
    now = 1
    for i in range(k-1):
        for j in range(i+1,k):
            bset[i].append(now)
            bset[j].append(now)
            now += 1
    length = len(bset[0])
    for i in bset:
        print(length," ".join(list(map(str,i))))
else:
    print("No")

# Example run
# Input:
57223618
# Output:
No
n=int(input())
f=0
for i in range(1,int(n**0.5)+3):
	if i*(i-1)//2==n:
		f=1
		break
if f==0:
	print("No")
	exit()
print("Yes")
print(i)
k=i
cnt=0
s=[[-1]*k for _ in range(k)]
for i in range(k):
	for j in range(k):
		if i<j:
			s[i][j]=cnt
			cnt+=1
ans=[[]for _ in range(k)]
for i in range(k):
	for j in range(k):
		if s[i][j]!=-1:
			ans[i].append(s[i][j]+1)
			ans[j].append(s[i][j]+1)
for x in ans:
	print(k-1,*x)


# Example run
# Input:
65153902
# Output:
No
from sys import stdout
printn = lambda x: stdout.write(str(x))
inn = lambda : int(input())
inl   = lambda: list(map(int, input().split()))
inm   = lambda:      map(int, input().split())
ins = lambda : input().strip()
DBG = True # and False
BIG = 999999999
R = 10**9 + 7

def ddprint(x):
  if DBG:
    print(x)

n = inn()
for k in range(n+5):
    m = k*(k-1)//2
    #ddprint("k {} m {}".format(k,m))
    if m>n:
        break
    if m<n:
        continue
    cnt = 1
    s = [ [] for i in range(k) ]
    for i in range(k-1):
        for j in range(i+1,k):
            s[i].append(cnt)
            s[j].append(cnt)
            cnt += 1
    print('Yes')
    print(k)
    for i in range(k):
        printn(k-1)
        for j in s[i]:
            printn(' ' + str(j))
        print('')
    exit()
print('No')


# Example run
# Input:
-6940
# Output:
No
N=int(input())
stock=[N-i for i in range(N)]

"""
if N==2:
    print("Yes")
    print(2)
    print(2,1,2)
    print(2,1,2)
    exit()
"""

N*=2
n=-int(-N**0.5//1)
if N/n==N//n and (n-N//n)==1:
    yoko=N//n
else:
    print("No")
    exit()

ans=[[0 for j in range(yoko)]for i in range(n)]

for i in range(N-1):
    for j in range(i,yoko):
        temp=stock.pop(-1)
        ans[i][j]=temp
        ans[j+1][i]=temp

print("Yes")
print(len(ans))
for item in ans:
    print(len(item), *item)


# Example run
# Input:
3
# Output:
Yes
3
2 1 2
2 1 3
2 2 3
N=int(input())
stock=[N-i for i in range(N)]

if N==2:
    print("Yes")
    print(2)
    print(2,1,2)
    print(2,1,2)
    exit()

N*=2
n=-int(-N**0.5//1)
if N/n==N//n:
    yoko=N//n
else:
    print("No")
    exit()

ans=[[0 for j in range(yoko)]for i in range(n)]

for i in range(N-1):
    for j in range(i,yoko):
        temp=stock.pop(-1)
        ans[i][j]=temp
        ans[j+1][i]=temp

print("Yes")
print(len(ans))
for item in ans:
    print(len(item), *item)

# Example run
# Input:
22349
# Output:
No
N=int(input())
x=1
while x*(x-1)//2<N:
    x+=1
if x*(x-1)//2>N:
    print('No')
else:
    print('Yes')
    print(x)
    a=[[] for i in range(x)]
    from itertools import combinations
    y=1
    for i,j in combinations(range(x),2):
        a[i].append(y)
        a[j].append(y)
        y+=1
    for l in a:
        print(x-1,*l)

# Example run
# Input:
25314138
# Output:
No
#make only 2 same number part of {1...N}
N=int(input())
a=[s+1 for s in range(N)]
flag=0
for i in range(N+1):
    if i*(i-1)//2==N: #kC2
        flag=1
        print("Yes")
        print(N)
        b=[[] for t in range(i)]
        c=1
        u=0
        for s in reversed(range(0,i)):
            for t in range(s):
                b[i-s-1].append(c)
                b[i-s+c-u-1].append(c)
                c+=1
            u+=s
        for x in range(i):
            print(i-1,' '.join(map(str, b[x])))
if flag==0:
    print("No")
            
            

# Example run
# Input:
-65906
# Output:
No
n=int(input())
k=0
for i in range(1,n+1):
  if (i*(i+1))//2==n:
    k=i
    break
else:
  k=-1
if k==-1:
  print('No')
else:
  arr=[[k] for _ in range(k+1)]
  tmp=0
  tk=0
  while k-tk>0:
    for i in range(tmp+1,tmp+k+1-tk):
      arr[tk].append(i)
    for i in range(tk+1,k+1):
      arr[i].append(tmp+i-tk)
    tmp+=(k-tk)
    tk+=1
  print('Yes')
  print(k+1)
  for row in arr:
    print(*row)

# Example run
# Input:
-12757070
# Output:
No
N = int(input())

# Nが三角数の場合はYes
M = (8 * N + 1)**0.5

if M.is_integer():
    M = (int(M) - 1) // 2
    print('Yes')
    print(M + 1)
    setNum = [[] for _ in range(N + 1)]
    for s in range(1, M + 2):
        ans = [M]
        V = set()
        for i in range(1, N + 1):
            if len(ans) > M:
                break
            if len(setNum[i]) >= 2:
                continue
            elif len(setNum[i]) == 0:
                ans.append(i)
                setNum[i].append(s)
            elif not setNum[i][0] in V:
                ans.append(i)
                setNum[i].append(s)
                V.add(setNum[i][0])
        print(*ans)
else:
    print('No')


# Example run
# Input:
5354599
# Output:
No
from itertools import combinations
n = int(input())
k = 0
for i in range(2*n):
  if i * (i - 1) == 2 * n:
    k = i
    break
if k>2:
  ans = [[k-1] for _ in range(k)]
  i = 1
  for a, b in combinations(range(k), 2):
    ans[a].append(i)
    ans[b].append(i)
    i += 1
  print('Yes')
  print(k)
  for ansi in ans:
    print(' '.join(list(map(str, ansi))))
else:
  print('No')


# Example run
# Input:
-163
# Output:
No
import math
N = int(input())
ans = ""

for i in range(1, int(math.sqrt(2*N)+1)):
    if i*(i+1) == 2*N:
        k = i
        break
else:
    print("No")
    exit()

for i in range(k+1):
    if i == 0:
        ans += str(k) + " " + " ".join(map(str, range(1, k+1))) + "\n"
        ans_list = [0, k]
    else:
        ans_list = [i+1 for i in ans_list]
        ans += str(k) + " " + " ".join(map(str, ans_list[:-1]+\
        list(range(ans_list[-1], ans_list[-1]+k-i)))) + "\n"
        ans_list = ans_list[:-1] + [ans_list[-1]-1]
        ans_list.append(ans_list[-1]+k-i)


print("Yes"+"\n{}\n".format(k+1)+ans[:-1])

# Example run
# Input:
38254
# Output:
No
n = int(input())
x = (-1+(1+8*n)**0.5)/2
m = int((-1+(1+8*n)**0.5)//2)
if x != m:
    print('No')
else:
    print('Yes')
    k = 2*n//m
    print(k)
    s = [[] for i in range(k)]
    add = 1
    for i in range(m):
        for j in range(i+1, k):
            s[i].append(add)
            s[j].append(add)
            add += 1
    for i in range(k):
        print(m, ' '.join([str(j) for j in s[i]]))

# Example run
# Input:
32
# Output:
No
l = {}
sum_n = 0
n = 1
while sum_n <= 10 ** 5:
    sum_n += n
    l[sum_n] = n
    n += 1
n = int(input())
if n not in l:
    print('No')
else:
    print('Yes')
    m = l[n]
    print(m+1)
    ans = [[m] for _ in range(m+1)]
    min_n = 1
    max_n = 1
    for i in range(1, m+1):
        max_n += i
        for j in range(min_n, max_n):
            ans[j-min_n].append(j)
            ans[i].append(j)
        min_n = max_n
    for i in ans:
        print(*i)


# Example run
# Input:
224
# Output:
No
N = int(input())
if N == 1:
  print('Yes')
  print(2)
  print(1, 1)
  print(1, 1)
  quit()

S = [{1, 2}, {1, 3}, {2, 3}]
n = 3
while n < N:
  l = len(S)
  s = set()
  for i in range(l):
    n += 1
    S[i].add(n)
    s.add(n)
  S.append(s)

if n == N:
  print('Yes')
  print(len(S))
  for s in S:
    print(len(s), *s)
else:
  print('No')

# Example run
# Input:
-241292
# Output:
No
N = int(input())
for k in range(1, N + 2):
    sn = k - 1
    if k * sn != 2 * N:
        continue

    print("Yes")
    print(k)
    s = [[0] * sn for _ in range(sn)]
    for i in range(sn):
        s[i][i] = s[i-1][i-1] + (i + 1)
        for j in range(i + 1, sn):
            s[i][j] = s[i][j-1] + j
            s[j][i] = s[i][j]
    s.append([s[i][i] for i in range(sn)])
    for x in s:
        print(sn, " ".join(map(str, x)))
    break
else:
    print("No")

# Example run
# Input:
7
# Output:
No
ans_data = []

def get_num_shugou(num):
    num_shuugou = -1
    for i in range(3, num + 1):
        if 2 * num == i * (i - 1):
            num_shuugou = i
            break
        elif 2 * num < i * (i - 1):
            break
    return num_shuugou

def get_piramid(num_shuugou):
    piramid = [[1]]
    for i in range(num_shuugou - 2):
        data = [piramid[-1][-1] + j + 1 for j in range(len(piramid) + 1)]
        piramid.append(data)
    return piramid


def data_append(now_list):
    print('{} {}'.format(len(now_list), ' '.join(list(map(str, now_list)))))


def make_data(high, width, piramid, now_list_kari, down_flg):
    now_list = now_list_kari.copy()
    now_list.append(piramid[high][width])

    if len(now_list) == len(piramid):
        data_append(now_list)
        return

    if down_flg:
        make_data(high + 1, width, piramid, now_list, down_flg)

    elif width == len(piramid[high]) - 1:
        down_flg = 1
        make_data(high + 1, width, piramid, now_list, down_flg)
    else:
        make_data(high, width + 1, piramid, now_list, down_flg)


def write_shugou(num_shuugou):
    piramid = get_piramid(num_shuugou)

    now_list = [piramid[i][-1] for i in range(len(piramid))]
    data_append(now_list)
    for i in range(num_shuugou - 1):
        make_data(i, 0, piramid, [], 0)

def main():
    num = int(input())
    num_shuugou = get_num_shugou(num)
    if num_shuugou == -1:
        print('No')
    else:
        print('Yes')
        print(num_shuugou)
        write_shugou(num_shuugou)



if __name__ == '__main__':
    main()

# Example run
# Input:
-233
# Output:
No
n = int(input())
if n == 3:
  print("Yes")
  print("3")
  print("2 1 2")
  print("2 3 1")
  print("2 2 3")
elif n==1:
  print("Yes")
  print("1")
  print("1 1")
  print("1 1")
else:
  print("No")

# Example run
# Input:
-1068
# Output:
No
N = int(input())
k = int((2*N)**0.5)+1
if k*(k-1)==2*N:
    print('Yes')
    print(k)
    S = [[0 for j in range(k-1)] for i in range(k)]
    sx,sy = 0,0
    n = 1
    while sx<k:
        for i in range(k-1-sx):
            S[sx][sy+i] = n+i
            S[sx+1+i][sy] = n+i
        n += k-1-sx
        sx += 1
        sy += 1
    for s in S:
        print(len(s),*s)
else:
    print('No')

# Example run
# Input:
22710854
# Output:
No
N = int(input())

now = 0
all_now = []

for i in range(N):
    now = now+(i+1)
    all_now.append(now)
    if N==now:
        f=1
        break
    elif N<now:
        f=-1
        break
    
all_now = all_now[2:i+1]
now_num = 0
re_num = 3

if f<0:
    print('No')
else:
    print('Yes')
    print(i+2)
    
    ans = [[]]*(i+2)
    
    if N ==1:
        ans[0] = 1
        ans[1] = 1
        print('1 1')
        print('1 1')
    else:
        ans[0] = [1, 2]
        ans[1] = [1, 3]
        ans[2] = [2, 3]
        
        k = 0
        
        for j in range(4, N+1):
            if j>all_now[now_num]:
                k = 0
                re_num = re_num+1
                now_num = now_num+1
                
            ans[k] = ans[k] + [j]
            ans[re_num] = ans[re_num] + [j]
            k = k+1
        
        for j in range(i+2):
            ans2 = [str(len(ans[j]))]
            for k1 in range(len(ans[j])):
                ans2 = ans2 + [str(ans[j][k1])]
            print(' '.join(ans2))
                

# Example run
# Input:
2180
# Output:
No
def etrc(n1,n2,rs):
    for r in range(n1):
        rc[n2].append(rs+r)
        rc[n2+r+1].append(rs+r)

n=int(input())
#n=6
x=int(((1+8*n)**0.5-1)/2)

rc=[[] for i in range(x+2)]

if n!=x*(x+1)//2:
    print("No")
else:
    print("Yes")
    print(x+1)

    rs=1
    for i in range(x):
        n1=x-i
        n2=i
        etrc(n1,n2,rs)
        rs=rs+n1

    for i in range(x+1):
        print(x, end=" ")
        for j in range(x):
            print(rc[i][j], end=" ")
        print()
 

# Example run
# Input:
449245
# Output:
No
N = int(input())

now = 0
all_now = []

for i in range(N):
    now = now+(i+1)
    all_now.append(now)
    if N==now:
        f=1
        break
    elif N<now:
        f=-1
        break
    
all_now = all_now[2:i+1]
now_num = 0
re_num = 3

if f<0:
    print('No')
else:
    print('Yes')
    print(i+2)
    
    ans = [[]]*(i+2)
    
    if N ==1:
        ans[0] = 1
        ans[1] = 1
        print(ans[0])
        print(ans[1])
    else:
        ans[0] = [1, 2]
        ans[1] = [1, 3]
        ans[2] = [2, 3]
        
        k = 0
        
        for j in range(4, N+1):
            if j>all_now[now_num]:
                k = 0
                re_num = re_num+1
                now_num = now_num+1
                
            ans[k] = ans[k] + [j]
            ans[re_num] = ans[re_num] + [j]
            k = k+1
        
        for j in range(i+2):
            ans2 = [str(len(ans[j]))]
            for k1 in range(len(ans[j])):
                ans2 = ans2 + [str(ans[j][k1])]
            print(' '.join(ans2))
                

# Example run
# Input:
831946
# Output:
No
n=int(input())

num = 8*n+1
import math
a=int(math.sqrt(num))
ok=False
for i in [a-2,a-1,a,a+1,a+2]:
    if i**2 == num:
        ok=True

if not ok:
    print("No")
    exit()

# Example run
# Input:
8796677
# Output:
No
from math import sqrt

x = int(input())
n = (sqrt(8*x+1) - 1) / 2
if int(n) == n:
  n = int(n)
  a = [[1], [1]]
  for i in range(2, n+1):
    ti = i*(i+1)//2
    b = list(range(ti+1-i,ti+1))
    for j, v in enumerate(b):
      a[j].append(v)
    a.append(b)
  print(len(a))
  for b in a:
    print(len(b), *b)
else:
  print("NO")



# Example run
# Input:
0
# Output:
2
1 1
1 1
N = int(input())
flag = False
k = 0
if N == 1:
  print('Yes')
  print(1)
  print(1,1)
  print(1,1)
  exit()
for i in range(N+1):
    if i*(i-1)/2 == N:
        flag = True
        k = i
        break
if flag == False:
    print('No')
else:
    L = []
    cnt = 0
    dot = 1
    for j in range(k-1):
        M = []
        while cnt < j+1:
            M.append(dot)
            cnt += 1
            dot += 1
        L.append(M)
        cnt = 0
    ans = []
    for i in range(k-1):
      S = L[i]
      for j in range(i+1,k-1):
        S += [L[j][i]]
      ans.append(S)
    T = []
    for i in range(k-1):
      T.append((i+1)*(i+2)//2)
    ans.append(T)
    print('Yes')
    print(k)
    for i in range(len(ans)):
      ans[i] = [k-1]+ans[i]
      for j in range(len(ans[i])):
        if j != len(ans[i])-1:
          print(ans[i][j],end = ' ')
        else:
          print(ans[i][j],end = '')
      print()

# Example run
# Input:
12
# Output:
No
from itertools import combinations
n = int(input())
i = 1
plus = 1
flg = False
while i <= n:
    if i == n:
        flg = True
        break
    plus += 1
    i += plus
if flg:
    res = {i : [] for i in range(plus+1)}
    for i, combi in enumerate(combinations(range(plus + 1), 2), 1):
        res[combi[0]].append(str(i))
        res[combi[1]].append(str(i))
    print(plus + 1)
    for i, val in res.items():
        print(str(plus) + " " + " ".join(val))
else:
    print("No")

# Example run
# Input:
-18850
# Output:
No
from itertools import combinations
N = int(input())
k = 2
while (k*(k-1))//2<N:
    k += 1
if (k*(k-1))//2!=N:
    print("No")
else:
    print("Yes")
    S = {i:[] for i in range(1,k+1)}
    cnt = 1
    for x in combinations(range(1,k+1),2):
        S[x[0]].append(cnt)
        S[x[1]].append(cnt)
        cnt += 1
    print(k)
    for i in range(1,k+1):
        print(len(S[i]),*S[i])

# Example run
# Input:
-426204934
# Output:
No
#make only 2 same number part of {1...N}
N=int(input())
a=[s+1 for s in range(N)]
flag=0
for i in range(N+1):
    if i*(i-1)//2==N: #kC2
        flag=1
        print("Yes")
        print(i)
        b=[[] for t in range(i)]
        c=1
        u=0
        for s in reversed(range(0,i)):
            for t in range(s):
                b[i-s-1].append(c)
                b[i-s+c-u-1].append(c)
                c+=1
            u+=s
        for x in range(i):
            print(i-1,' '.join(map(str, b[x])))
if flag==0:
    print("No")
            
            

# Example run
# Input:
-163
# Output:
No
n = int(input())
if n % 2 == 0:
    print("No")
else:
    if n == 1:
        print("Yes")
        print(2)
        print("1 1")
        print("1 1")
    elif n == 3:
        print("Yes")
        print(3)
        print("2 1 2")
        print("2 2 3")
        print("2 3 1")
    elif n == 9:
        print("Yes")
        print(5)
        print("4 1 2 3 4")
        print("4 1 5 6 7")
        print("4 2 5 8 9")
        print("3 3 6 8")
        print("3 4 7 9")
    else:
        print("No")


# Example run
# Input:
298151
# Output:
No