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

if n & 1:
    print('Yes')
    print(n)
    print(1, n)
    left, right = 1, 2
    for i in range(n - 1):
        print(2, left, right)
        if i & 1:
            right += 2
        else:
            left += 2
else:
    print('No')


# Example run
# Input:
-640183291
# Output:
Yes
-640183291
1 -640183291
N = int(input())

"""
N = 2
 No
N = 3
 1,2. 2,3. 3,1
N = 4
 No
N = 5
 No
N = 6
 1,2,4 1,3,6 4,5,6 2,3,5

個数がN(Nー1)でしょうと言うのは考察を諦めない力
全ての部分集合の長さって同じじゃね？って気付けるかどうか。。。
あとは６で具体的に構築できるかどうか勝負かな。
"""

def solve(k):
  print("Yes")
  print(k)
  G = []
  for i in range(1,k+1):
    G = calcG(i-1,G)
  for g in G:
    print(str(len(g)) + " " + " ".join(map(str,g)))
    
def calcG(i,G):
  st = i*(i-1) // 2 + 1
  en = i*(i+1) // 2
  #print(i,st,en)
  new = list(range(st,en+1))
  for j in range(len(G)):
    G[j].append(new[j])
  G.append(new)
  return G

for i in range(2,1000):
  if i*(i-1)//2 == N:
    solve(i)
    exit(0)

print("No")

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

if N >= 4:
    print('No')
elif N == 1:
    print('No')
elif N == 2:
    print('No')
else:
    print('Yes')
    print(3)
    print(2, 1, 2)
    print(2, 3, 1)
    print(2, 2, 3)

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

if n == 1:
    print("Yes")
    print(2)
    print(1)
    print(1)
elif n == 2:
    print("No")
    exit(0)
elif n == 3:
    print("Yes")
    print(3)
    print(1,1,2)
    print(2,2,3)
    print(3,3,1)
elif n >= 4:
    print("No")
    exit(0)


# Example run
# Input:
7883823
# Output:
No
n=int(input())
for i in range(1,400):
  if i*(i+1)//2==n:
    D=[[0]*i for l in range(i)]
    stopcnt=i
    cnt=0
    a,b=0,0
    print('Yes')
    print(i+1)
    for j in range(n):
      D[a][j-b]=j+1
      cnt+=1
      if cnt==stopcnt:
        a+=1
        b+=stopcnt-1
        cnt=0
        stopcnt-=1
    for a in range(i):
      for b in range(a,i):
        D[b][a]=D[a][b]
    DD=[]
    for j in range(i):
      DD.append(D[j][j])
    D.append(DD)
    for j in D:
      print(len(j),*j)
    exit()
print('No')

# Example run
# Input:
236801619
# Output:
No
K = int(input())

def calc_n(K):
  if K == 1:
    return "No"
  for n in range(1, int(K/2)+2):
    if n*(n+1)/2 == K:
      return n
  return "No"

N = calc_n(K)
if not isinstance(N, int):
  print(N)
else:
  print("Yes")
  print(N+1)
  last = [i for i in range(1, N+1)]
  count = 2
  first_set = [str(i) if i == 1 else str(sum(last[:i-1])+1) for i in range(1, N+1)]
  print(N, " ".join(first_set))
  last_set = [str(sum(last[:i])) for i in range(1,N+1)]
  print(N, " ".join(last_set))
  while count != N+1:
    first_number = sum(last[:count-1])+1
    other_set = [i for i in range(first_number, first_number+count)]
    other_set.extend([first_number+count*(i+1)-1+sum(last[:i-1]) for i in range(1, N-count+1)])
    count += 1
    other_set = [str(i) for i in other_set]
    print(N, " ".join(other_set))

# Example run
# Input:
-213058
# Output:
No
def main():
    from collections import deque
    from decimal import Decimal, getcontext

    getcontext().prec = 1000

    N = int(input())

    # {1,...,N}*2を分割
    # k個の集合があって
    # 各集合は他のk-1個の集合に対し共通要素を1個ずつ合わせてk-1個の要素をもつ

    sq = Decimal(N * 8 + 1).sqrt()
    cond = sq % 2 == 1  # 奇数か

    if not cond:
        print('No')
        return
    k = int((1 + sq) // 2)  # Decimalのままだとrangeの引数に使えない
    print('Yes')
    print(k)

    deqs = []
    it = iter(range(1, N + 1))
    for _ in range(k):
        print(k - 1, end=' ')
        t = []
        for deq in deqs:
            x = deq.popleft()
            t.append(x)
        u = []
        for _ in range(k - 1 - len(t)):
            x = next(it)
            u.append(x)
        print(*t, *u)
        deqs.append(deque(u))


if __name__ == '__main__':
    main()


# Example run
# Input:
679804
# Output:
No
# https://atcoder.jp/contests/tenka1-2018-beginner/tasks/tenka1_2018_d
# D - Crossing

N=int(input())
a=set()
b={}

for i in range(1000):
    if i*(i+1)%2==0:
        s= i*(i+1)//2
        if s<=10**5:
            a.add(s)
            b[s]=i
        else:
            break
            
if N not in a:
    print("No")
else:
    print("Yes")
    print(b[N]+1)
    r=[0 for _ in range(N)] #kaisuu
    t=[ [] for _ in range(b[N]+1)]
    for i in range(b[N]):
        r[i] +=1
    t[0]= [i+1 for i in range(b[N])]
    print(b[N],*t[0])

    for i in range(1,b[N]+1):
        for j in range(i):
            for k,num in enumerate(t[j]):
                if r[num-1]==1:
                    t[i].append(num)
                    r[num-1]+=1
                    break
        for k in range(N):
            if r[k]==0:
                r[k] +=1
                t[i].append(k+1)
                if len(t[i])>=b[N]:
                    break
        print(b[N],*t[i])

        
        
        
        
        #print("i=",i)
        #print(r)
#        for j,num in enumerate(r):
#            if num==1:
#                t[i].append(j+1)
#                r[j]+=1
#                break
        #print("t",t)
        #print(r)
#        for k,num in enumerate(r):
#            if num==0:
#                t[i].append(k+1)
#                r[k]+=1
#            if len(t[i])==b[N]:   
#                break
#        else:
#            pass
#        print(b[N],*t[i])

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

for k in range(N + 1):
    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:
224
# Output:
No
from itertools import combinations
N = int(input())
K = 0
for i in range(2,N+1):
    if N==(i*(i-1))//2:
        K = i
        break
if K==0:
    print("No")
else:
    S = {i:[] for i in range(1,K+1)}
    cnt = 1
    for x in combinations(range(1,K+1),2):
        i,j = x
        S[i].append(cnt)
        S[j].append(cnt)
        cnt += 1
    print("Yes")
    print(K)
    for i in range(1,K+1):
        print(len(S[i]),*S[i])

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

P = [0]
p = 1
for i in range(10**3):
    P.append(P[-1] + p)
    p += 1

i = 2
while P[i] < n:
    i += 1
if P[i] > n:
    print("No")
else:
    print("Yes")
    m = i+1
    S = [[] for i in range(m)]
    for i in range(m):
        s = 1 if i==0 else 1+P[i-1]
        for j in range(m-1):
            S[i].append(s)
            if j < i-1:
                s += 1
            elif j == i-1:
                s += i+1
            else:
                s += j+1
    print(m)
    for i in range(m):
        print(m-1, " ".join([str(j) for j in S[i]]))

# print(S)

# Example run
# Input:
-241292
# Output:
No
import sys

input_methods=['clipboard','file','key']
using_method=1
input_method=input_methods[using_method]

tin=lambda : map(int, input().split())
lin=lambda : list(tin())
mod=1000000007

#+++++

def gg(n):
	for i in range(n+1):
		#print(2*n, i*i+1)
		if 2*n == i*(i+1):
			return i+1
		if 2*n < i*(i+1):
			return -1
	return -1

def main():
	n = int(input())
	#b , c = tin()
	#s = input()
	g_num = gg(n)
	if g_num == -1:
		return 'No'
	print('Yes')
	print(g_num)
	n_num = g_num-1
	ggg=[]
	ggg.append(list(range(1, n_num+1)))
	next=n_num+1
	for ig in range(g_num-1):
		next_group=[]
		for ip, g in enumerate(ggg):
			next_group.append(g[len(ggg)-ip-1])
		while len(next_group) < n_num:
			next_group.append(next)
			next+=1
		ggg.append(next_group)
	for g in ggg:
		print(n_num, *g)
	
		
	
	
	
#+++++
isTest=False

def pa(v):
	if isTest:
		print(v)
		
def input_clipboard():
	import clipboard
	input_text=clipboard.get()
	input_l=input_text.splitlines()
	for l in input_l:
		yield l

if __name__ == "__main__":
	if sys.platform =='ios':
		if input_method==input_methods[0]:
			ic=input_clipboard()
			input = lambda : ic.__next__()
		elif input_method==input_methods[1]:
			sys.stdin=open('inputFile.txt')
		else:
			pass
		isTest=True
	else:
		pass
		#input = sys.stdin.readline
			
	ret = main()
	if ret is not None:
		print(ret)

# Example run
# Input:
3556893
# Output:
No
N = int(input())
S = []
hoge = 1
i = 0
while hoge <= N:
    S.append([])
    i += 1
    for j in range(i):
        S[-1].append(hoge)
        hoge += 1

if S[-1][-1] == N:
    print("Yes")
else:
    print("NO")
    exit()

N = len(S)
print(N+1)

for i in range(N):
    x,y = 0,i
    for j in range(i+1):
        x = j
        print(S[y][x],end=" ")
    for j in range(i+1,N):
        y = j
        print(S[y][x],end=" ")
    print()
for i in S:
    print(i[-1],end = " ")

# Example run
# Input:
11609
# Output:
NO
N=int(input())
cN=N

d=1
while N%2==0:
  N//=2
  d+=1

k=-1
for i in range(1,int(N**0.5)+1):
  if N%i==0:
    if abs(i*(2**d)-N//i)==1:
      k=max(i*(2**d),N//i)
      break
    elif abs((N//i)*(2**d)-i)==1:
      k=max((N//i)*(2**d),i)
      break

if k==-1:
  print("No")
else:
  print("Yes")
  print(k)
  S=[[] for _ in range(k)]
  n=0
  for j in range(k):
    for i in range(1,k-j):
      S[j].append(n+i)
      S[i+j].append(n+i)
    n+=i
  
  for i in range(k):
    print(k-1," ".join(map(str,S[i])))


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

if N % 3 == 0 :
  for _ in range(3) :
    t = N // 3
    a = list(range(t * 0 + 1, t * 1 + 2))
    b = list(range(t * 1 + 1, t * 2 + 2))
    c = list(range(t * 2 + 1, t * 3 + 2))
    c[-1] = 1
    print('Yes')
    print(3)
    print(t + 1, *a)
    print(t + 1, *b)
    print(t + 1, *c)
else :
  print('No')

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

n1 = 8*N+1
a = int(n1**0.5)

if n1==a**2:
    n = (-3+a)//2
    if (-3+a)%2:
        print("No")
    else:
        d = [[0]*(n+1) for _ in range(n+2)]
        d[0][0] = 1
        d[0][1] = 2
        d[1][0] = 2
        d[1][1] = 3
        d[2][0] = 3
        d[2][1] = 1
        for i in range(1, n):
            v = 4+((i-1)*(i+4)//2)
            c = 2+i

            for j in range(c):
                d[c][j] = v+j
                d[j][c-1] = v+j

        print("Yes")
        print(n+2)
        for i in range(n+2):
            print(n+1, *d[i], sep=" ")
else:
    print("No")

# Example run
# Input:
5184928
# Output:
No
import itertools
N = int(input())
X = int(((8 * N + 1)**0.5 - 1) // 2)
if N != X * (X + 1) // 2:
    print('No')
    exit()
index = 0
ans = [[X] for _ in range(X + 2)]
for i, j in itertools.combinations(range(1, X + 2), 2):
    index += 1
    ans[i] += [index]
    ans[j] += [index]
print('Yes')
print(X + 1)
[print(*_) for _ in ans[1:]]


# Example run
# Input:
244278
# Output:
No
import itertools
N = int(input())
k = int((2 * N) ** 0.5) + 1
if (k-1) * k == 2 * N:
    print('Yes')
    print(k)
    S = [[] for _ in range(k)]
    n = 1
    for i, j in itertools.combinations(range(k), 2):
        S[i].append(str(n))
        S[j].append(str(n))
        n += 1
    for s in S:
        print(len(s), ' '.join(s))
else:
    print('No')


# Example run
# Input:
2526
# Output:
No
import math
n = int(input())
x = (-1+math.sqrt(1+8*n))/2
if not x.is_integer():
  print ('No')
  exit (0)
x = int(x)
ans = []
k = 1
for i in range(x+1):
  a = []
  for j in range(x):
    if j >= i:
      a.append(k)
      k +=1
    else:
      a.append(ans[j][i-1])
  ans.append(a)
print ('Yes')
print (x+1)
for i in range(x+1):
  print (x,*ans[i]) 

# Example run
# Input:
2
# Output:
No
from itertools import combinations
N = int(input())
m = (1+(1+8*N)**(1/2))/2
if int(m) != m:
    print('No')
else:
    print('Yes')
    for c in combinations(range(1, N+1), int(m) - 1):
        print(int(m) - 1, *c)


# Example run
# Input:
38254
# Output:
No
n=int(input())
if not ((1+(1+8*n)**0.5)/2).is_integer():
  print('No')
else:
  k=int((1+(1+8*n)**0.5)//2)
  ans=[[] for _ in range(k)]
  cnt=1
  for i in range(k):
    for j in range(i+1,k):
      ans[i].append(cnt)
      ans[j].append(cnt)
      cnt+=1
  print('Yes')
  print(k)
  for i in range(k):
    print(k-1,*ans[i])

# Example run
# Input:
23
# Output:
No
import sys
from itertools import combinations
n = int(input())

for i in range(1, 1000):
  if n == i*(i+1)//2:
    print("Yes")
    print(i+1)
    anslist = [[] for _ in range(i+1)]
    for j, v in enumerate(combinations([int(x) for x in range(i+1)], r=2)):
      anslist[v[0]].append(j+1)
      anslist[v[1]].append(j+1)
    for ans in anslist:
      print(len(ans), *ans)
    sys.exit()

print("No")

# Example run
# Input:
-5064
# Output:
No
from math import sqrt
n = int(input())
k = (1+sqrt(1+8*n))/2
if k.is_integer():
    print('Yes')
    k = int(k)
    ans = [set() for _ in range(k)]
    i = 1
    for j in range(k-1):
        for l in range(j+1,k):
            ans[j].add(i)
            ans[l].add(i)
            i += 1
    for a in ans:
        print(k,' '.join(map(str,a)))
else:
    print('No')


# Example run
# Input:
0
# Output:
Yes
1
def main():
    n=int(input())
    for k in range(1,450):
        if k*(k+1)==2*n:
            print("Yes")
            print(k+1)
            break
    else:
        print("No")
        return 0
    ans=[]
    cnt=1
    for i in range(k+1):
        ans.append([])
        for j in range(i):
            ans[i].append(ans[j][i-1])
        for j in range(i,k):
            ans[i].append(cnt)
            cnt+=1
    for i in ans:
        print(len(i),*i)
main()

# Example run
# Input:
32
# Output:
No
n=int(input())
if int((2*n)**(1/2))*int((2*n)**(1/2)+1)==2*n:
  a=int((2*n)**(1/2))
  print("Yes")
  print(a+1)
  A=[[] for i in range(a+1)]
  x=0
  for i in range(a):
    for j in range(a-i):
      x=x+1
      A[i].append(x)
  B=[[] for i in range(a+1)]
  x=0
  for i in range(a):
    for j in range(a-i):
      x=x+1
      B[i].append(x)
  C=[[] for i in range(a+1)]
  for i in range(a):
    for j in range(a-i):
      C[a-j].append(B[i][j])
  D=[[] for i in range(a+1)]
  for i in range(a+1):
    D[i]=A[i]+C[i]
  for i in range(a+1):
    print(a,end=" ")
    for j in range(a):
      print(D[i][j],end=" ")
    print()
else:
  print("No")

# Example run
# Input:
645801
# 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("2")
  print("1 1")
  print("1 1")
else:
  print("No")

# Example run
# Input:
3132478
# Output:
No
n=int(input())
if not ((1+(1+8*n)**0.5)/2).is_integer():
  print('No')
else:
  k=int((1+(1+8*n)**0.5)//2)
  ans=[[] for _ in range(k)]
  cnt=1
  for i in range(k):
    for j in range(i+1,k):
      ans[i].append(cnt)
      ans[j].append(cnt)
      cnt+=1
  print('Yes')
  for i in range(k):
    print(k-1,*ans[i])

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

tmp = 0
flag = True
for k in range(N + 1):
    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
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:
57942
# Output:
No
n = int(input())

if n == 2:
    print('Yes\n2\n2 1 2\n2 1 2')
if n == 3:
    print('Yes\n3\n2 1 2\n2 3 1\n2 2 3')
if n >= 4:
    print('No')

# Example run
# Input:
-143891
# Output:
n = int(input())
A = []
for i in range(1, int(n ** .5 + 3) * 2):
    A.append(i * (i - 1) // 2)

if n in A:
    print("Yes")
    x = A.index(n) + 1
    ans = [[] for _ in range(x)]
    now = 1
    l = 0
    while l < x:
        for i in range(x - l - 1):
            ans[l].append(now)
            ans[l + 1 + i].append(now)
            now += 1
        l += 1
    print(x)
    for i in range(x):
        print(x - 1, *ans[i])
        
else:
    print("No")


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

# Example run
# Input:
21181
# Output:
No
N = int(input())
K = (((8 * N + 1) ** (1/2) - 1) / 2)

def recursive(k):
    if k == 2:
        return [[1, 2], [1, 3], [2, 3]]
    else:
        before = recursive(k - 1)
        r = [_ for _ in range(1 + k * (k - 1) // 2, 1 + k * (k + 1) // 2)]
        return ([before[_] + [r[_]] for _  in range(len(r))] + [r])
if K.is_integer():
    print('Yes')
    K = int(K)
    [print(K, ' '.join(map(str, ary))) for ary in recursive(K)]
else:
    print('No')

# Example run
# Input:
46988
# Output:
No
N = int(input())
k = 1
yes_n = (k * (k+1)) // 2
flag = False
while N >= yes_n:
    if N == yes_n:
        flag = True
        break
    k += 1
    yes_n = (k * (k+1)) // 2
if flag:
    ans = []
    max_n = 1
    for i in range(k+1):
        tmp = []
        for j in range(i):
            tmp += [ans[j][i-1]]
        for j in range(k-i):
            tmp += [str(max_n)]
            max_n += 1
        ans += [tmp]
    print('Yes')
    print(k+1)
    for a in ans:
        print(k, ' '.join(a))
else:
    print('No')

# Example run
# Input:
0
# 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(2)
    print(1,1)
    print(1,1)
else :
    print("No")
    

# Example run
# Input:
480
# Output:
No
n = int(input())
k = int((n*2)**.5)
if k*(k+1)//2 != n:
  print("No")
  exit()
print("Yes")
print(k+1)
l = [set() for _ in range(k+1)]
t = 0
for i in range(k):
  for j in range(i+1):
    t += 1
    l[i].add(t)
    l[j].add(t)
  l[-1].add(t)
for x in l:
  print(k," ".join(map(str,x)))

# Example run
# Input:
0
# Output:
Yes
1
0
N = int(input())
k = int((2 * N) ** 0.5) + 1
if k * (k - 1) == 2 * N:
    print('Yes')
    a = range(1, k)
    S = [[1]]
    for i in range(1, k - 1):
        S[0].append(S[0][-1] + i)
    for i in range(1, k - 1):
        S.append(list(range(S[0][i], S[0][i] + i + 1)))
        for j in range(i + 1, k - 1):
            S[-1].append(S[-1][-1] + j)
    S.append([1])
    for i in range(2, k):
        S[-1].append(S[-1][-1] + i)
    for i in range(k):
        print(' '.join(map(str, [k - 1] + S[i])))
else:
    print('No')

# Example run
# Input:
1037673021
# Output:
No
#D問題
N = int(input())

if N%2 == 0:
    print("No")
else:
    print("Yes")
    n = N//2
    print(n+2)
    print(n+1,end=" ")
    for i in range(n+1):
        print(i+1,end=" ")
    print()
    print(n+1,end=" ")
    for i in range(n+1):
        print(n+i+1,end=" ")
    print()
    for i in range(n):
        print(2,end=" ")
        print(i+1,n+i+2)

        

# Example run
# Input:
84
# Output:
No
n = int(input())
if(n % 3 != 0):
  print("No")
else:
  print("Yes")
  s = int(n/3) - 1 #余分の数
  t = 2 + s #最初の3の数
  print(3+s) #集合の総数
  a = list(range(1,t+1))
  b = list(map(lambda x:x+t-1,a))
  c = list(map(lambda x:x+t-1,b))
  c[len(c)-1] = 1
  k = (' '.join(map(str, a)))
  print("{} {}".format(t,k))
  k = (' '.join(map(str, b)))
  print("{} {}".format(t,k))
  k = (' '.join(map(str, c)))
  print("{} {}".format(t,k))
  for i in range(s):
    print("3 {} {} {}".format(a[i+1],b[i+1],c[1+i]))

# Example run
# Input:
0
# Output:
Yes
2
1 1
1 1
1 1
def main():

	n = int(input())

	num = 0
	sum = 0
	while sum <= n:
		if sum == n:
			print("Yes")
			break
		else:
			num += 1
			sum += num
	else:
		print("No")
		return
	
	Ss = []
	for i in range(num+1):
		Ss.append([])
	
	insert = 0
	for i in range(1,num+1)[::-1]:
		key = num - i
		for j in range(1,i+1):
			insert += 1
			Ss[key].append(insert)
			Ss[key+j].append(insert)
	
	print(len(Ss))
	for i in range(len(Ss)):
		ans = ""
		ans += str(len(Ss[i])) + " "
		ans += ' '.join(map(str, Ss[i]))
		print(ans)




if __name__ == '__main__':
	main()

# Example run
# Input:
253491
# Output:
No
N = int(input())
for k in range(N+2):
    if k * (k-1) == 2 * N:
        S = [[] for _ in range(k+1)]
        n = 1
        for i in range(2, k+1):
            for j in range(1, i):
                S[i].append(n)
                S[j].append(n)
                n += 1
        print('Yes')
        print(k)
        for i in range(1, k+1):
            ans = [len(S[i])] + S[i]
            print(' '.join(map(str, ans)))
        exit()
print('No')

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


# Example run
# Input:
-1
# Output:
No
n= int(input())
k=((8*n+1)**0.5-1)/2
if k.is_integer():
    ik=int(k)
    prel,newl=[],[]
    nexv,last=0,0
    for i in range(ik+1):
        if i==0:
            print(*[t+1 for t in range(ik)])
            nexv=1
        else:
            last+=ik-i+1
            newl=[b+last+1 for b in range(ik-i)]
            for b in range(len(prel)):prel[b]+=1
            print(*(prel+[nexv]+newl))
            prel.append(nexv)
            if newl:nexv=newl[0]
else:
    print(-1)

# Example run
# Input:
31959
# Output:
-1
import itertools
N = int(input())
X = int(((8 * N + 1)**0.5 - 1) // 2)
if N != X * (X + 1) // 2:
    print('No', X)
    exit()
index = 1
ans = [[X] for _ in range(X + 2)]
for i, j in itertools.combinations(range(1, X + 2), 2):
    ans[i] += [index]
    ans[j] += [index]
    index += 1
print('Yes')
[print(*_) for _ in ans[1:]]


# Example run
# Input:
1382
# Output:
No 52
import math

def main():
    n = int(input())
    k = int(math.floor(math.sqrt(2*n)))
    if k * (k + 1) != 2 * n:
        print("No")
    else:
        print("Yes")
        setList = [[0]*k for i in range(k+1)]
        start = 1
        end = start + k
        cnt = 0
        for j in range(k):
            p = 0
            for p, i in enumerate(range(start, end)):
                setList[j][j+p] = i
                setList[j+p+1][j] = i
            cnt += 1
            start = end
            end = end + k - cnt
        for i in range(k+1):
            s = str(i+1) + " "
            for sl in setList[i]:
                s += str(sl) + " "
            print(s)
        pass

if __name__ == '__main__':
    main()

# Example run
# Input:
6825
# Output:
No
n = int(input())
if n >= 4:
    print('NO')
else:
    print('YES')

# Example run
# Input:
734
# Output:
NO
def yaku(n):
    ret = []

    for i in range(n):
        if n % (i+1) == 0:
            ret.append(i+1)

    return list(set(ret))

def choufuku(t, sets):
    for s in sets:
        cnt = 0
        for i in s:
            if i in t:
                cnt += 1
        if cnt > 1:
            return True
    return False

n = int(input())

ele = [int(i / 2)+1 for i in range(n*2)]

yak = yaku(n*2)

for i in range(len(yak)):
    if yak[i] == 1:
        continue
    nsets = yak[i]
    nelem = int(n * 2 / nsets)

    ret = [[] for i in range(nsets)]

    for e in ele:

        for r in ret:
            if len(r) == nelem:
                continue
            elif e in r:
                continue
            else:
                tmp = r[:]
                tmp.append(e)
                if choufuku(tmp, ret):
                    continue
                else:
                    r.append(e)
                    break

    l = 0
    for r in ret:
        l += len(r)
        
    if l != n*2:
        continue

    dame = 0

    for i in range(len(ret) - 1):
        for j in range(i+1, len(ret)):
            if len(set(ret[i] + ret[j])) + 1 != (len(ret[i]) + len(ret[j])):
                dame = 1
                break
    
    if dame == 1:
        continue
    

    print('Yes')
    print(len(ret))
    for r in ret:
        print(str(len(r)) + ' ', end = "")
        for rr in r:
            print(str(rr) + ' ', end = "")
        print('')
    break

if dame == 1:
    print('No')

# Example run
# Input:
341
# Output:
No
n=int(input())
k=int((n*2)**0.5)
if (k*(k+1))//2==n:
  print('Yes')
  print(k+1)
else:
  print('No')
  exit()
s=[[] for _ in range(k+1)]
t=1
for i in range(1,k+1):
  for j in range(i):
    s[i].append(t)
    s[j].append(t)
    t+=1
for i in s:
  print(len(i),*i)


# Example run
# Input:
51856
# Output:
No