Harryxun/stf_run huggingface dataset:
import numpy as np
a = [list(input()) for i in range(3)]
a = np.ravel(a)
n = int(input())
b = [input() for i in range(n)]

ans = 'No'
def check(a,b):
    return set(a).issubset(b)

for i in range(3):
    if check(a[i*3:i*3+2],b) or check(a[i:i+6:3],b) or check(a[0:8:4],b) or check(a[2:6:2],b):
        ans = 'Yes'

print(ans)

### FIXED CODE ###

# ABC157 B
import numpy as np
a = [[input().split() for l in range(3)]]
a = np.ravel(a)
n = int(input())
b = [input() for i in range(n)]
ans = 'No'

def check(a,b):
    return set(a).issubset(b)

for i in range(3):
    if check(a[i*3:(i*3)+3],b) or check(a[i:i+7:3],b) or check(a[0:9:4],b) or check(a[2:7:2],b):
        ans = 'Yes'

print(ans)
s = input()
t = input()
S = ''.join(sort(list(s)))
T = ''.join(reverse(list(t)))
print("Yes" if S < T else "No")


### FIXED CODE ###

s = input()
t = input()
S = ''.join(list(sorted(s)))
T = ''.join(list(sorted(t,reverse = True)))
print("Yes" if S < T else "No")
# seishin.py
N, A = map(int, input().split())

ans = N
for k in range(1, 41):
    left = 0; right = N+1
    while left+1 < right:
        mid = (left + right) // 2
        if mid**(k+1) < N:
            left = mid
        else:
            right = mid
    m = right
    v = (m-1)**(k+1)
    for i in range(k+1):
        v //= m-1
        v *= m
        if N <= v:
            ans = min(ans, A*k + (m-1)*(k+1) + (i+1))
            break
print(ans)

### FIXED CODE ###

# seishin.py
N, A = map(int, input().split())

ans = N
if N > 1:
    for k in range(1, 41):
        left = 0; right = N+1
        while left+1 < right:
            mid = (left + right) // 2
            if mid**(k+1) < N:
                left = mid
            else:
                right = mid
        m = right
        v = (m-1)**(k+1)
        for i in range(k+1):
            v //= m-1
            v *= m
            if N <= v:
                ans = min(ans, A*k + (m-1)*(k+1) + (i+1))
                break
print(ans)
#-*-coding:utf-8-*-
import sys
input=sys.stdin.readline

def main():
    numbers=[]
    #n = int(input())
    n,m = map(int,input().split())
    #numbers=list(map(int,input().split()))
    numbers=[list(map(int,input().split())) for _ in range(m)]
    dp={}
    for number in numbers:
        for n in number:
            if n not in dp:
                dp[n]=1
            else:
                dp[n]+=1
    
    for i in range(1,len(dp)+1):
        print(dp[i])

if __name__=="__main__":
    main()

### FIXED CODE ###

#-*-coding:utf-8-*-
import sys
input=sys.stdin.readline

def main2():
    numbers=[]
    n,m = map(int,input().split())
    numbers=[list(map(int,input().split())) for _ in range(m)]
    dp=[0]*n
    for number in numbers:
        for n in number:
            dp[n-1]+=1
    for ans in dp:
        print(ans)

def main():
    numbers=[]
    n,m = map(int,input().split())
    numbers=[list(map(int,input().split())) for _ in range(m)]
    dp={}
    for number in numbers:
        for n in number:
            if n not in dp:
                dp[n]=1
            else:
                dp[n]+=1
    print(dp)
    for i in range(1,len(dp)+1):
        print(dp[i])

if __name__=="__main__":
    main2()
n=int(input())
a=list(map(int,input().split()))
if n==1:
  print(1)
  exit()
a.sort()
b=[]
for i in range(a[0],a[n-1]-1):
  ans=0
  ans+=a.count(i)+a.count(i+1)+a.count(i+2)
  b.append(ans)

b.sort()
print(b[-1])

### FIXED CODE ###

import collections
n=int(input())
a=list(map(int,input().split()))
a1=[x-1 for x in a]
a2=[x+1 for x in a]
b=a+a1+a2
c=collections.Counter(b)

print(max(c.values()))
a, b, c, d = input()
print("Yes" if a==b==c or b==c==f else "No")

### FIXED CODE ###

a, b, c, d = input()
print("Yes" if a==b==c or b==c==d else "No")
l = map(int, raw_input().split())
if l[0] > l[1]:
    print "a > b"
elif l[0] == l[1]:
    print "a == b"
else
    print "a < b"

### FIXED CODE ###

l = map(int, raw_input().split())
if l[0]>l[1]:
    print "a > b"
elif l[0]==l[1]:
    print "a == b"
else:
    print "a < b"
a, b, t = map(int()input())
print((t//a)*b)

### FIXED CODE ###

a,b,t = map(int,input().split())
print((t//a)*b)
N = int(input())
A = map(int, raw_input().split())

def dp(A):
    if len(A) == 2:
        return A[0] + A[1] if A[0] + A[1] > -A[0] + -A[1] else -A[0] + -A[1]
    A_last, rA_last = A[-1], -A[-1]
    A, rA = A[:-1], A[:-1]
    rA[-1] = -rA[-1]
    return max( dp(A)+A_last, dp(rA)+rA_last)


print '{}'.format(dp(A))


### FIXED CODE ###

# D - Flipping Signs
# https://atcoder.jp/contests/abc125/tasks/abc125_d

N = int(input())
A = list(map(int, raw_input().split()))

ng_cnt = 0

for i in range(N):
    if A[i] < 0:
        ng_cnt += 1
        A[i] = -A[i]

if ng_cnt % 2 == 0:
    print '{}'.format( sum(A) )
else:
    print '{}'.format( sum(A) - min(A)*2)
x = list(input().split())
if x[0] / x[2] <= x[3]:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

d,t,s=map(int,input().split())
if d<=t*s:
    print("Yes")
else:
    print("No")
n, m = (int(xi) for xi in input().split())

a = []
diff = []
a0 = 0
a1 = int(input())
a.append(a1)
diff.append(a1+1)

if m>1:
    for xi in range(m-1):
        a0 = a1
        a1 = int(input())
        a.append(a1)
        diff.append(a1-a0)

if a1==n-1:
    diff.append(n-a1+1)
else:
    diff.append(n-a1+1)

# print(diff)
# print(a)

p = [0]
p.append(1)
p.append(1)
for xi in range(3,max(diff)):
    add = (p[xi-1]+p[xi-2])%1_000_000_007
    p.append(add)

# print(p)

# print(len(diff))
out = 1
for xi in range(len(diff)+2):
    out *= p[diff[xi]-1]

print(out% 1_000_000_007 )


### FIXED CODE ###

n, m = (int(xi) for xi in input().split())

a = []
diff = []
a0 = 0
if m>0:
    a1 = int(input())
    a.append(a1)
    diff.append(a1+1)

    if m>1:
        for xi in range(m-1):
            a0 = a1
            a1 = int(input())
            a.append(a1)
            diff.append(a1-a0)

    if a1==n-1:
        diff.append(n-a1+1)
    else:
        diff.append(n-a1+1)


else:
    if n==1: diff.append(n+1)
    diff.append(n+2)

# print(diff)
# print(a)

p = [0]
p.append(1)
p.append(1)
for xi in range(3,max(diff)+2):
    add = (p[xi-1]+p[xi-2])%1_000_000_007
    p.append(add)

# print(p)

# print(len(diff))
out = 1
for xi in range(len(diff)):
    out *= p[diff[xi]-1]

print(out% 1_000_000_007 )
# import numpy as np
# import sys
# sys.setrecursionlimit(100)
N, X = map(int, input().split())
if N > 1000:
    exit()

if 2 * X > N:
    X = N - X

#座標の作成
dp = [[-1] * (N+3)]
for i in range(N+1):
    tmp = [-1]
    for j in range(N+1):
        if i <= j:
            tmp.append(0) #到達していないマス
        else:
            tmp.append(-1) #壁(範囲外)
    tmp.append(-1)
    tmp.reverse()
    dp.append(tmp)
dp.append([-1] * (N+3))
# print (np.array(dp))


#m: 0:右へ, 1:左下へ, 2:左上へ
def moving(x, y, total, m):
    if x == X and y == 1 and dp[x][y] == 1:
        # print ('D')
        return total
    if m == 0: #右に動く時
        tmp = 0
        while dp[x-1][y+1] == 0: #右に進める時
            dp[x-1][y+1] = 1 #右進んだマスを到達したことにする
            tmp += 1
            x -= 1
            y += 1
        if dp[x-1][y+1] == -1: #右側が壁の時-->左下に進む
            # print ('1-B')
            return moving(x, y, total + tmp, 1)
        if dp[x-1][y+1] == 1: #右側が光の線の時-->左上へ進む
            tmp += 1
            # print ('1-C')
            return moving(x-1, y+1, total + tmp, 2)
    
    if m == 1: #左下へ動く時
        tmp = 0
        while dp[x+1][y] == 0: #左下に進める時
            dp[x+1][y] = 1
            tmp += 1
            x += 1
        if dp[x+1][y] == -1: #左下が壁の時-->左上に進む
            # print ('2-C')
            return moving(x, y, total + tmp, 2)
        if dp[x+1][y] == 1: #左下が光の線の時-->左上に進む
            tmp += 1
            # print ('2-C')
            return moving(x+1, y, total + tmp, 2)
    
    if m == 2: #左上に動く時
        tmp = 0
        while dp[x][y-1] == 0: #左上に進める時
            dp[x][y-1] = 1
            tmp += 1
            y -= 1
        if dp[x][y-1] == -1: #左上が壁の時-->右に進む
            # print ('3-A')
            return moving(x, y, total + tmp, 0)
        if dp[x][y-1] == 1: #左上が光の線の時-->左下に進む
            tmp += 1
            # print ('3-B')
            return moving(x, y-1, total + tmp, 1)

X += 1
print (moving(X, 1, 0, 0))
# print (np.array(dp))

### FIXED CODE ###

N, X = map(int, input().split())

ans = N
a = N - X
b = X
while a != b:
    if a >= b:
        a, b = b, a
    if b%a != 0:
        ans += 2 * a * (b//a)
        b = b%a
    else:
        ans += 2 * a * (b//a - 1)
        b = a
print (ans + a)
n = int(input())
#print("n=",n)
xy_s = [[int(v) for v in input().split()] for _ in range(n)]
v = {}
for i in range(n):
  for j in range(n):
    if i == j:
      continue
    dx = xy_s[i][0] - xy_s[j][0]
    dy = xy_s[i][1] - xy_s[j][1]
    pq = (dx, dy)
    if pq in v:
      v[pq] += 1
    else:
      v[pq] = 1
    
    #v.append([xy_s[i][0] - xy_s[j][0] , xy_s[i][1] - xy_s[j][1]])
#print(v)
counts = v.values()
m = max(counts)
ans = n - m
#print("n={}, m={}, ans={}".format(n, m, ans))
print(ans)

### FIXED CODE ###

n = int(input())

if n == 1:
  print(1)
else:
  #print("n=",n)
  xy_s = [[int(v) for v in input().split()] for _ in range(n)]
  v = {}
  for i in range(n):
    for j in range(n):
      if i == j:
        continue
      dx = xy_s[i][0] - xy_s[j][0]
      dy = xy_s[i][1] - xy_s[j][1]
      pq = (dx, dy)
      if pq in v:
        v[pq] += 1
      else:
        v[pq] = 1
    
      #v.append([xy_s[i][0] - xy_s[j][0] , xy_s[i][1] - xy_s[j][1]])
  #print(v)
  counts = v.values()
  m = max(counts)
  ans = n - m
  #print("n={}, m={}, ans={}".format(n, m, ans))
  print(ans)
import math

ans = (N+1) // 2
print(ans
     )

### FIXED CODE ###

import bisect
import cmath
import heapq
import itertools
import math
import operator
import os
import random
import re
import string
import sys
from collections import Counter, deque, defaultdict
from copy import deepcopy
from decimal import Decimal
from fractions import gcd
from functools import lru_cache, reduce
from operator import itemgetter, mul, add, xor

import numpy as np

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(10 ** 9)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7
# MOD = 998244353

N = int(sys.stdin.buffer.readline())
print((N +1)//2)
in = input()
data = in.splite(' ')
A = data[0]
B = data[1]
c = (B - 1) // (A - 1)

print(c)



### FIXED CODE ###

in_data = input()
 
data = in_data.split(' ')
A = int(data[0])
B = int(data[1])
if B == 1:
  print("0")
else:
  c = (B - 1) // (A - 1)
  d = (B - 1) / (A - 1)
  if c < d:
    c = c + 1
  print(c)
N, M, C = map(int, input().split())
b = [map(int, input().split())]
a = []
for i in range(N):
    a.append([int(i) for i in input().split()])

count = 0
for i in range(N):
    tmp = 0
    for j in range(M):
        tmp += b[j] * a[i][j]
    if tmp + C > 0:
        count += 1

print(count)

### FIXED CODE ###

N, M, C = map(int, input().split())
b = [int(i) for i in input().split()]
a = []
for i in range(N):
    a.append([int(i) for i in input().split()])

count = 0
for i in range(N):
    tmp = 0
    for j in range(M):
        tmp += b[j] * a[i][j]
    if tmp + C > 0:
        count += 1

print(count)
H,A,B=map(int,input().split())
l=[]
s=0
while True:
    for i in range(A):
        if s==H:
            print(l.count('b'))
            exit()
        s+=1
        list.append('b')
    for j in range(B):
        if s==H:
            print(l.count('b'))
            exit()
        s+=1
        list.append('a')


### FIXED CODE ###

N,A,B=map(int,input().split())
s=0
a=N//(A+B)
s+=A*a
b=N-a*(A+B)
if b>=A:
    s+=A
else:
    s+=b
print(s)
N=int(input())
S,T=map(str,input().split())
U=[]
for i in range(len(T)):
  U.append(S[i],T[i])
print(U)


### FIXED CODE ###

N=int(input())
S,T=map(str,input().split())
a=str()
for i in range(N):
  a+=S[i]
  a+=T[i]
print(a)
a = list(map(int,input().split())
i=0         
for i in len(a):
         if a[i] == 0:
         print(i+1)


### FIXED CODE ###

line = list(map(int, input().split()))
for i in range(5):
  if line[i] == 0:
    print(i+1)
def gcd(a, b):
	while b:
		a, b = b, a % b
	return a

def lcm(a, b):
	return a * b // gcd (a, b)

a,b,c,d = map(int,input().split())
ac_can = int((a-1)//c)
ad_can = int((a-1)//d)
acd_can = int((a-1)//lcm(c,d))
bc_can = int(b//c)
bd_can = int(b//d)
bcd_can = int(b//lcm(c,d))
print(b-a+1-(bc_can+bd_can-bcd_can-(ac_can+ad_can-acd_can)))

### FIXED CODE ###

W, H, x, y = map(int, input().rstrip().split())
 
max_area = W * H / 2.0
if x == W / 2 and y == H / 2:
    print(max_area, 1)
else:
    print(max_area, 0)
N ,K = map(int, input().split())

import math

A = list(map(int, input().split()))
d = [0] * N

#二分探索
min = 1
max = max(A)

while True:
    X = (min + max)//2
    for i in range(N):
        if a[i] % X == 0:
            d[i] = A[i]//X - 1
        else:
            d[i] = A[i]//X
    if sum(d) <= K:
        max = X 
    else:
        min = X
    #print(min, max)
    
    if max - min <= 1:
        print(int(max))
        break


### FIXED CODE ###

N ,K = map(int, input().split())

A = list(map(int, input().split()))
d = [0] * N

#二分探索
min1 = 0
max1 = max(A) + 1

while True:
    X = (min1 + max1)//2
    for i in range(N):
        if A[i] % X == 0:
            d[i] = A[i]//X - 1
        else:
            d[i] = A[i]//X
    if sum(d) <= K:
        max1 = X 
    else:
        min1 = X
    #print(min1, max1)

    if max1 - min1 <= 1:
        print(int(max1))
        break
def main():
    n = input()
    edges = []
    nodes = [0] * n
    children = {i: [] for i in xrange(n)}
    for _ in xrange(n - 1):
        a, b = map(int, raw_input().split())
        a -= 1
        b -= 1
        edges.append([a, b])
        nodes[a] += 1
        nodes[b] += 1
        children[a].append(b)
        children[b].append(a)

    def search(i, deg, dist, visited):
        ret = []
        for j in children[i]:
            if nodes[j] < deg:
                return dist
            if nodes[j] > deg:
                continue
            if j in visited:
                continue
            visited.add(j)
            ret.append(search(j, deg, dist + 1, visited))
        if ret:
            return min(ret)
        else:
            return dist

    def key(i):
        deg = nodes[i]
        return deg, search(i, deg, 1, {i})

    nodes = sorted([node for node in xrange(n)],
                   key=lambda i: key(i))
    cc = map(int, raw_input().split())
    cc.sort()
    ans = [0] * n
    for node, c in zip(nodes, cc):
        ans[node] = c
    score = 0
    for a, b in edges:
        score += min(ans[a], ans[b])
    print score
    print ' '.join(map(str, ans))


if __name__ == '__main__':
    main()


### FIXED CODE ###

import random
import sys
sys.setrecursionlimit(10**5 + 10)


def main():
    n = input()
    edges = []
    nodes = [0] * n
    children = {i: [] for i in xrange(n)}
    for _ in xrange(n - 1):
        a, b = map(int, raw_input().split())
        a -= 1
        b -= 1
        edges.append([a, b])
        nodes[a] += 1
        nodes[b] += 1
        children[a].append(b)
        children[b].append(a)

    cc = map(int, raw_input().split())
    cc.sort(reverse=True)
    ans = [0] * n

    def dfs(node, visited):
        for nex in children[node]:
            if nex in visited:
                continue
            visited.add(nex)
            dfs(nex, visited)
        ans[node] = cc.pop()

    while True:
        start = random.randrange(n)
        if len(children[start]) > 1:
            break
    dfs(start, {start})

    score = 0
    for a, b in edges:
        score += min(ans[a], ans[b])
    print score
    print ' '.join(map(str, ans))


if __name__ == '__main__':
    main()
from math import ceil,floor
import sys
n = int(input())
T = [0 for i in range(n)]
A = [0 for i in range(n)]
for i in range(n):
    T[i],A[i] = map(int,input().split())
t = 1
a = 1
for i in range(n):
    t = T[i]*max(ceil(t/T[i]), ceil(a/A[i]))
    a = A[i]*max(ceil(t/T[i]), ceil(a/A[i]))

print(t+a)

### FIXED CODE ###

s =set(input().split())
print(len(s))
n,a.b = map(int,input().split())
print(min(4*a,b))

### FIXED CODE ###

n,a,b = map(int,input().split())
print(min(n*a,b))
import numpy as np
#import math
#from fractions import gcd

def main():

    ##get int
    first_input = list(map(lambda x:int(x), input().split(" ")))
    #second_input = list(map(lambda x:int(x), input().split(" ")))

    ##get float
    #first_input = list(map(lambda x:float(x), input().split(" ")))
    #second_input = list(map(lambda x:float(x), input().split(" ")))

    ##get string
    #first_input = input().split(" ")

    R = first_input[0]

    print(R*2*np.pi)

if __name__ == '__main__':
    main()


### FIXED CODE ###

#import numpy as np
import math
#from fractions import gcd

def main():

    ##get int
    first_input = list(map(lambda x:int(x), input().split(" ")))
    #second_input = list(map(lambda x:int(x), input().split(" ")))

    ##get float
    #first_input = list(map(lambda x:float(x), input().split(" ")))
    #second_input = list(map(lambda x:float(x), input().split(" ")))

    ##get string
    #first_input = input().split(" ")

    R = first_input[0]

    print(R*2*math.pi)

if __name__ == '__main__':
    main()
N = int(input())
flag = False
for i in range(10):
    if N%i == 0 and N//i < 10:
        flag = True
if flag:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

N = int(input())
flag = False
for i in range(1, 10):
    if N%i == 0 and N//i < 10:
        flag = True
if flag:
    print("Yes")
else:
    print("No")
M,N = map(int, input().split())
if M>=2 and N>=2 : 
    print(M-2)*(N-2)
else:
    print(N*M-2)
    

### FIXED CODE ###

M, N = map(int, input().split())
if M==1 and N==1:
    print(1)
elif M > 2 and N > 2:
    print((M - 2) * (N - 2))
elif M==1 or N==1:
    print(N * M - 2)
else:
    print(0)
def popcount(i):
    assert 0 <= i < 0x100000000
    i = i - ((i >> 1) & 0x55555555)
    i = (i & 0x33333333) + ((i >> 2) & 0x33333333)
    return (((i + (i >> 4) & 0xF0F0F0F) * 0x1010101) & 0xffffffff) >> 24
memo = [None] * 300000
def do2(x):
    if memo[x] is not None:
        return memo[x]
    cnt = 0
    while x != 0:
        x = x % popcount(x)
        cnt += 1
    memo[x] = cnt
    return cnt

def do():
    ll = int(input())
    s = input()
    n = int(s, 2)

    x = n
    cnt = 0
    ss = bin(x)[2:]
    cnt += 1
    num1 = ss.count("1")
    num1m = num1 - 1
    num1p = num1 + 1
    rs = ss[::-1]
    res1m = 0
    res1p = 0
    for j in range(len(rs)):
        if rs[j] == "1":
            res1m += pow(2, j, num1m)
            res1m %= num1m
            res1p += pow(2, j, num1p)
            res1p %= num1p

    #print(res1m, res1p, num1m, num1p)
    for i in range(len(s)):
        #print("i", i)
        if s[i] == "1": # 0になるから
            #print("down")
            #print(res1m, pow(2, ll - i -1, num1m))
            x = res1m - pow(2, ll - i -1, num1m)
            x %= num1m
        elif s[i] == "0": # 1になるから
            #print("up")
            #print(res1p, pow(2, ll - i -1, num1p))
            x = res1p + pow(2, ll - i-1, num1p)
            x %= num1p

        if x == 0:
            print(1)
            continue
        print(do2(x) + 1)
do()

### FIXED CODE ###

def popcount(i):
    assert 0 <= i < 0x100000000
    i = i - ((i >> 1) & 0x55555555)
    i = (i & 0x33333333) + ((i >> 2) & 0x33333333)
    return (((i + (i >> 4) & 0xF0F0F0F) * 0x1010101) & 0xffffffff) >> 24
memo = [None] * 300000
def do2(x):
    if memo[x] is not None:
        return memo[x]
    cnt = 0
    while x != 0:
        x = x % popcount(x)
        cnt += 1
    memo[x] = cnt
    return cnt

def do():
    ll = int(input())
    s = input()
    n = int(s, 2)

    x = n
    cnt = 0
    ss = bin(x)[2:]
    cnt += 1
    num1 = ss.count("1")
    num1m = num1 - 1
    num1p = num1 + 1
    rs = ss[::-1]
    res1m = 0
    res1p = 0
    for j in range(len(rs)):
        if rs[j] == "1":
            if num1m != 0 and num1m != -1:
                res1m += pow(2, j, num1m)
                res1m %= num1m
            res1p += pow(2, j, num1p)
            res1p %= num1p

    #print(res1m, res1p, num1m, num1p)
    for i in range(len(s)):
        #print("i", i)
        if s[i] == "1": # 0になるから
            #print("down")
            #print(res1m, pow(2, ll - i -1, num1m))
            if num1m == 0 or num1m == -1:
                print(0)
                continue
            x = res1m - pow(2, ll - i -1, num1m)
            x %= num1m
        elif s[i] == "0": # 1になるから
            #print("up")
            #print(res1p, pow(2, ll - i -1, num1p))
            x = res1p + pow(2, ll - i-1, num1p)
            x %= num1p

        if x == 0:
            print(1)
            continue
        print(do2(x) + 1)
do()
from itertools import permutations

N,M = map(int,input().split())

Matrix = [[False for i in range(N)] for j in range(N)] #隣接行列

for i in range(N) :
    Matrix[i][i] = True

for i in range(N) :
    row,column = map(int,input().split())
    Matrix[row-1][column-1] = True
    Matrix[column-1][row-1] = True
    
arange = range(2,N+1)
ans = 0
for pm in permutations(arange) :
    P = [1] + list(pm)
    for row,column in zip(P,P[1:]) :
        if not Matrix[row-1][column-1] :
            break
    else :
        ans += 1
print(ans)


### FIXED CODE ###

from itertools import permutations

N,M = map(int,input().split())

L = [[False for i in range(N)] for j in range(N)]

for i in range(N) :
    L[i][i] = True
for i in range(M) :
    a,b = map(int,input().split())
    a -= 1
    b -= 1
    L[a][b] = True
    L[b][a] = True

arange = range(2,N+1)

res = 0
for P in permutations(arange) :
    P = [1] + list(P)
    for S,G in zip(P,P[1:]) :
        if not L[S-1][G-1] :
            break
    else :
        res += 1
print(res)
n, m = list(map(int, input().split()))
root_list = []
for _ in range(m):
    tmp = list(map(int, input().split()))
    if tmp[0] != tmp[1] and tmp not in root_list:
    root_list.append(list(map(int, input().split())))

answer_list = [0] * (n-1)
done_list = [1]
already_list = [1]
while len(root_list) > 0 and 0 in answer_list:
    if len(done_list) == 0:
        break
    tmp_list = []
    copy_root_list = root_list.copy()
    for num in done_list:
        for l in root_list:
            if l[1] == num:
                if answer_list[int(l[0]-2)] == 0:
                    answer_list[int(l[0]-2)] = num
                    tmp_list.append(l[0])
                    already_list.append(l[0])
                    copy_root_list.remove(l)
                else:
                    copy_root_list.remove(l)
            elif  l[0] == num and l[0] != l[1]:
                if answer_list[int(l[1]-2)] == 0:
                    answer_list[int(l[1]-2)] = num
                    tmp_list.append(l[1])
                    already_list.append(l[1])
                    copy_root_list.remove(l)
                else:
                    copy_root_list.remove(l)
    root_list = copy_root_list
    done_list = tmp_list

if 0 not in answer_list:
    print("Yes")
    for i in answer_list:
        print(int(i))
else:
    print("No")
    
    

### FIXED CODE ###

from collections import deque

n, m = list(map(int, input().split()))
root_dict = {}

for _ in range(m):
    a, b = list(map(int, input().split()))
    if a not in root_dict:
        root_dict[a] = deque([b])
    else:
        root_dict[a].append(b)
    if b not in root_dict:
        root_dict[b] = deque([a])
    else:
        root_dict[b].append(a)

visited = [1] + [-1] * (n-1)

done = deque([1])

while done:
    x = done.popleft()
    while root_dict[x]:
        i = root_dict[x].popleft()
        if visited[i-1] < 0:
            visited[i-1] = x
            done.append(i)

if -1 in visited:
    print("No")
else:
    print("Yes")
    for i in range(1, n):
        print(visited[i])