Harryxun/stf_run huggingface dataset:
N, M = map(int, input().split())
vote_result_list = sorted(list(map(int,input().split())))[::-1]
border = sum(vote_result_list)/(4*M)
print("Yes" if vote_result_list[M-1] >= border else "No")

### FIXED CODE ###

a,b,c = map(int,input().split())
a,b = b,a
a,c = c,a
print(a,b,c)
if sorted(arr) == [5,5,7]:
  print('YES')
else:
  print('NO')

### FIXED CODE ###

arr = map(int, input().split())
if sorted(arr) == [5,5,7]:
  print('YES')
else:
  print('NO')
import sys

def solve(N: int, A: "List[int]"):
    result = 0.
    for i in range(N):
        result += 1./A[i]
    print(1./result)
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    A = [ int(next(tokens)) for _ in range(N) ]  # type: "List[int]"
    solve(N, A)

if __name__ == '__main__':
    main()

### FIXED CODE ###

#!/usr/bin/env python3
import sys


def solve(a: int, s: str):
    if a >= 3200:
        print(s)
    else:
        print('red')
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    a = int(next(tokens))  # type: int
    s = next(tokens)  # type: str
    solve(a, s)

if __name__ == '__main__':
    main()
s = input()
s2 = s.split('dream')
s3 = ''.join(s2).split('erase')
s3.remove('er')
s3.remove('r')
if len(s3) != 0:
  print("NO")
else:
  print("YES")

### FIXED CODE ###

s = input()
s2 = s.split('eraser')
s3 = ''.join(s2).split('erase')
s4 = ''.join(s3).split('dreamer')
s5 = ''.join(s4).split('dream')
s5 = list(set(s5))
if len(s5) == 1 and s5[0] == '':
  print("YES")
else:
  print("NO")
import numpy as np
from math import gcd
from functools import reduce
def LGcd(l):
    a = l[0]
    for i in range(1,len(l)):
        a = gcd(a,l[i])
    return a
N, X = map(int,input().split())
k = np.array(input().split())
k = k.astype(np.int32)
k -= X
if N == 1:
    print(str(abs(k[0])))
else:
    print(str(LGcd(k)))

### FIXED CODE ###

# 正の数を受け取るように定義
def gcd(a,b):
    if b == 0:
        return a 
    return gcd(b,a % b)

N, X = map(int,input().split())
k = [abs(int(x) - X) for x in input().split()] # リスト内包表記で入力の受け取り
a = k[0]
for i in range(1,N):
    a = gcd(a,k[i])
print(str(a))
num = map(int, raw_input().split())

num.sort()

print(num[0], num[1], num[2])

### FIXED CODE ###

num = list(map(int, input().split()))

num.sort()

print(num[0], num[1], num[2])
category_number, popular_product_number = input().split()
product_list = input().split()
votes_number = sorted(product_list)[-popular_product_number]
border = sum(product_list)/4/popular_product_number
if votes_number < border:
  print('No')
else:
  print('Yes')

### FIXED CODE ###

category_number, popular_product_number = input().split()
product = input().split()
product_list = [int(i) for i in product]
votes_number = sorted(product_list)[-int(popular_product_number)]
border = sum(product_list)/4/int(popular_product_number)
if votes_number < border:
  print('No')
else:
  print('Yes')
import itertools
n = int(input())
p =[int(i) for i in input().split()]
q =[int(i) for i in input().split()]
a = 0
b = 0
cnt = 0
p1= p.copy()
p1.sort()
n_list = list(itertools.permutations(p1))
for i in n_list:
    if list(i)==p:
        a = cnt +1
    elif list(i)==q:
        b = cnt +1
    cnt += 1
        
print(abs(a-b))
    

### FIXED CODE ###

import itertools
n = int(input())
p =[int(i) for i in input().split()]
q =[int(i) for i in input().split()]
a = 0
b = 0
cnt = 0
p1= p.copy()
p1.sort()
n_list = list(itertools.permutations(p1))
for i in n_list:
    if list(i)==p:
        a = cnt +1
    if list(i)==q:
        b = cnt +1
    cnt += 1
        
print(abs(a-b))
n, m = map(int, input().split())
ship = []
for i in range(m):
    ship.append(tuple(map(int, input().split())))

ship.sort()
for s in ship:
    if s[0] != 1 and s[1] != n:
        ship.remove(s)

i = 0

while ship[i][0] == 1:
    i += 1

for j in range(i):
    for k in range(i+1, m):
        if ship[j][1] == ship[k][0]:
            print("POSSIBLE")
            exit()

print("IMPOSSIBLE")


### FIXED CODE ###

n, m = map(int, input().split())
ship_1 = [False]*(n+1)
ship_n = [False]*(n+1)
for i in range(m):
    a, b = map(int, input().split())
    if a == 1:
        ship_1[b] = True
    elif b == n:
        ship_n[a] = True

for i in range(len(ship_1)):
    if ship_1[i] and ship_n[i]:
        print("POSSIBLE")
        exit()

print("IMPOSSIBLE")
n = int(input())
s = tuple(input())

cnt = 0
w = {'R', 'G', 'B'}

for i in range(n-2):
  for j in range(i+1, n-1):
    for k in range(j+1, n):
        if {s[i], s[j], s[k]} == w and j-i != k-j:
          cnt += 1
      
print(cnt)


### FIXED CODE ###

n = list(map(int, input()))

ans = 'No'
for i in range(len(n)):
  if n[i] == 7:
    ans = 'Yes'
    
print(ans)
A，B，C = list(map(int, input().split()))
vincent = str(A) + str(B) + str(C)
vincent1 = list(set(vincent))
if len(vincent1) == 2:
  print('Yes')
else:
  print('No')


### FIXED CODE ###

A, B, C = list(map(int, input().split()))
vincent = [A,B,C]
vincent1 = list(set(vincent))
if len(vincent1) == 2:
    print("Yes")
else:
    print("No")
A, B, C = [int(i) for i in input().split()]
print(min(B // A, C)

### FIXED CODE ###

A, B, C = [int(i) for i in input().split()]
print(min(B // A, C))
import numpy as np
N,M,*A = map(int, open('0').read().split())
A = np.sort(A)
B = np.cumsum(np.concatenate([[0],A[::-1]]))
l = -1
r = 10**6
while l+1<r:
  s = (l+r)//2
  cnt = np.sum(N-np.searchsorted(A,s-A))
  if cnt>=M:
    l = s
  else:
    r = s
ind = np.searchsorted(A,r-A)
M -= np.sum(N-ind)
ans = np.sum(B[N-ind]+A*(N-ind))+M*l
print(ans)


### FIXED CODE ###

N, M = map(int, input().split())
A = [int(c) for c in input().split()]
A.sort(reverse=True)
B = A[::-1]
l = 0
r = 10**6
def f(m):
  cnt = 0
  j = 0
  for i in range(N):
    while j<N:
      if A[i]+B[j]>=m:
        cnt += N-j
        break
      j += 1
  return cnt>=M
while l+1<r:
  n = (l+r)//2
  if f(n):
    l = n
  else:
    r = n
C = [0]
for i in range(N):
  C += [C[-1]+B[i]]
ans = 0
j = 0
m = 0
flag = False
for i in range(N):
  while j<N:
    if A[i]+B[j]>l:
      ans += C[-1]-C[j]+A[i]*(N-j)
      m += N-j
      break
    j += 1
ans += (M-m)*l
print(ans)
Sd_ = input()
T_ = input()
Sd = []
T = []
S = []
check = False
for i in range(len(Sd_)):
    Sd.append(Sd_[i])
for i in range(len(T_)):
    T.append(T_[i])
num = 0
for a in range(len(Sd)-1,0,-1):
    if Sd[a] is '?':
        num += 1
    else:
        num = 0
    if num >= len(T):
        for m in range(len(T)):
            Sd[a+m] = T[m]
        for s in range(len(Sd)):
            if Sd[s] is '?':
                S.append('a')
            else:
                S.append(Sd[s])
        print(''.join(S))
        exit()


for i in range(len(Sd)-1,0,-1):
    if Sd[i] is not '?':
        if Sd[i] in T_:
            check = True
            num = T_.find(Sd[i])
            for n in range(len(T_)):
                if n < num:
                    if Sd[i-num+n] is not '?':
                        check = False
                        break
                else:
                    if Sd[i-num+n] is not T_[n] and Sd[i-num+n] is not '?':
                        check = False
                        break
            if check:
                for m in range(len(T)):
                    Sd[i-num+m] = T[m]
                break

if check:
    for s in range(len(Sd)):
        if Sd[s] is '?':
            S.append('a')
        else:
            S.append(Sd[s])
    print(''.join(S))
else:
    print('UNRESTORABLE')

### FIXED CODE ###

Sd_ = input()
T_ = input()
Sd = []
T = []
S = []
for i in range(len(Sd_)):
    Sd.append(Sd_[i])
for i in range(len(T_)):
    T.append(T_[i])


def check(s, t, n):
    for i in range(len(t)):
        if s[n + i] is not t[i] and s[n + i] is not '?':
            return False
    return True


m = len(Sd) - len(T)
while m >= 0:
    if check(Sd[:], T[:], m):
        for j in range(len(T)):
            Sd[m + j] = T[j]
        for a in range(len(Sd)):
            if Sd[a] is '?':
                S.append('a')
            else:
                S.append(Sd[a])
        print(''.join(S))
        exit()
    m -= 1
print('UNRESTORABLE')
I=lambda:list(map(int,input().split()))[::-1];m,n=I();l=[I()+[i]for i in range(m)];c=[0]*-~n;a=[0]*m
for y,p,i in sorted(l):c[p]+=1;a[i]='%06d'%p+'%06d'%c[p]
print('\n'.join(t))

### FIXED CODE ###

I=lambda:map(int,input().split())
n,m=I()
l=[[]for _ in range(n+1)]
for i in range(m):
  p,y=I()
  l[p].append([y,i])
a=[]
for p in range(1,n+1):
  l[p].sort()
  for i,t in enumerate(l[p]):
    a.append([t[1],'%06d'%p+'%06d'%-~i])
a.sort()
for t in a:
  print(t[1])
# DP
N, M = map(int, input().split())
broken = list(map(int, input().split()))

MOD = 10**9+7
dp = [0 for i in range(N+2)]
dp[N] = 1

for i in reversed(range(N)):
    if i in broken:
        continue
    dp[i] = dp[i+1] + dp[i+2]
    dp[i] %= MOD

print(dp[0])


### FIXED CODE ###

N, B = map(int, input().split())
ana = []
dp = [0] * (N+2)

for i in range(B):
    ana.append(int(input()))

mod = 1000000007

dp[N] = 1
for i in reversed(range(N)):
    if len(ana) >= 1 and i == ana[-1]:
        dp[i] = 0
        if len(ana) != 0:
            ana.pop(-1)
        continue
    dp[i] = dp[i + 1] + dp[i + 2]
print(dp[0] % mod)
n, m = map(int,input().split())

l = [[0 for _ in range(2)] for _ in range(n)]

print(l)
f = 0
con = ""

for i in range(n):
    s, c = (list(map(int,input().split())))
    if l[s-1][1] == 0 or l[s-1][0] == c:
        if s == 1 and c == 0:
            f = 1
            break
        l[s-1][0] = c
        l[s-1][1] = 1
    else:
        f = 1
        break

if f:
    print(-1)
else:
    for i in range(n):
        con += str(l[i][0])
    print(con)

### FIXED CODE ###

# n = int(input())
n, m = map(int,input().split())
# l = [[0 for _ in range(n)] for _ in range(n)]
l = []
f = 0

for i in range(m):
    l.append(list(map(int,input().split())))

# print(l)

for i in range(1000):
    si = str(i)
    if len(si) == n:
        for j in range(m):
            # print(si, l)
            if si[l[j][0]-1] == str(l[j][1]):
                # print('OK')
                f = 0
            else:
                f = 1
                break
    else:
        continue
    if f == 0:
        print(si)
        exit()

print(-1)
def main():
    W, H, x, y = map(int, input().split())

    if x == W/2 and y == H/2:
        pat = 1

    print(W*H/2.0, pat)

if __name__ == "__main__":
    main()

### FIXED CODE ###

def main():
    W, H, x, y = map(int, input().split())
    pat = 0

    if x == W/2 and y == H/2:
        pat = 1

    print((W*H)/2.0, pat)

if __name__ == "__main__":
    main()
n,k,s = (int(i) for i in input().split()) 
ans = []
for i in range(k):
    ans.append(s)
if n > k:
for j in range(n-k):
    ans.append(1)
print(ans)

### FIXED CODE ###

n,k,s = (int(i) for i in input().split())
ans = ""
if s != 10**9:
    for i in range(k):
        ans += str(s) + " "
    if n > k:
        for j in range(n-k):
            ans += str(10**9) + " "
    print(ans)
else:
    for i in range(k):
        ans += str(s) + " "
    if n > k:
        for j in range(n-k):
            ans += str(1) + " "
    print(ans)
import sys
from fractions import gcd

n = int(input())
a = list(set(map(int, input().split())))

if n <= 2:
    print(max(a))
    sys.exit()

l = [0] * n
r = [0] * n
l[0] = a[0]
r[-1] = a[-1]

for i in range(n - 1):
    l[i + 1] = gcd(l[i], a[i + 1])
    r[-1 - (i + 1)] = gcd(r[-1 - i], a[-1 - (i + 1)])

ans = 0
for i in range(n - 2):
    ans = max(ans, gcd(l[i], r[i + 2]))
ans = max(ans, l[-2], r[1])
print(ans)


### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
 
 
def gcd(a, b):
    if a < b:
        a, b = b, a
    if b == 0:
        return a
    return gcd(b, a % b)
 
 
L = [0] * (N + 1)
R = [0] * (N + 1)
for i in range(N):
    L[i+1] = gcd(L[i], A[i])
 
for i in range(N-1, -1, -1):
    R[i] = gcd(R[i+1], A[i])
 
ans = 1
for i in range(N):
    ans = max(ans, gcd(L[i], R[i+1]))
 
print(ans)
class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        self.parents[x] = self.find(self.parents[x])
        return self.parents[x]

    def unite(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if x == y:
            return
        if self.parents[x] > self.parents[y]:
            x, y = x, y
        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def size(self, x):
        return -self.parents[self.find(x)]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]


N, M, K = map(int, input().split())
uf = UnionFind(N)
friends = [[] for _ in range(N)]
blocks = [[] for _ in range(N)]
root = {}

for i in range(M):
    a, b = map(int, input().split())
    friends[a - 1].append(b - 1)
    friends[b - 1].append(a - 1)
    uf.unite(a - 1, b - 1)

roots = uf.roots()
for r in roots:
    size = uf.size(r)
    root[r] = size - 1

for i in range(K):
    c, d = map(int, input().split())
    if uf.same(c - 1, d - 1):
        blocks[c - 1].append(d - 1)
        blocks[d - 1].append(c - 1)

ans = []
for i in range(N):
    ans.append(root[uf.find(i)] - len(blocks[i]) - len(friends[i]))
print(*ans)


### FIXED CODE ###

class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        self.parents[x] = self.find(self.parents[x])
        return self.parents[x]

    def unite(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if x == y:
            return
        if self.parents[x] > self.parents[y]:
            x, y = y, x
        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def size(self, x):
        return -self.parents[self.find(x)]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]


N, M, K = map(int, input().split())
uf = UnionFind(N)
friends = [[] for _ in range(N)]
blocks = [[] for _ in range(N)]
root = {}

for i in range(M):
    a, b = map(int, input().split())
    friends[a - 1].append(b - 1)
    friends[b - 1].append(a - 1)
    uf.unite(a - 1, b - 1)

roots = uf.roots()
for r in roots:
    size = uf.size(r)
    root[r] = size - 1

for i in range(K):
    c, d = map(int, input().split())
    if uf.same(c - 1, d - 1):
        blocks[c - 1].append(d - 1)
        blocks[d - 1].append(c - 1)

ans = []
for i in range(N):
    ans.append(root[uf.find(i)] - len(blocks[i]) - len(friends[i]))
print(*ans)
s=input()
K=int(input())

ans=[]
ans.append(s)


for i in range(len(s)-1):
 for j in range(i+1):
  cut_s=s[j:j+len(s)-i-1]
  if cut_s not in ans:
   ans.append(cut_s)
   ans.sort()

answer=ans[K-1]
print(answer)

### FIXED CODE ###

s=input()
K=int(input())
 
ans=[]
ans.append(s)
 
 
for i in range(len(s)):
 for j in range(len(s)-i):
  cut_s=s[i:i+j+1]
  ans.append(cut_s)
  ans=sorted(set(ans))
  if len(ans)>K:
   if cut_s==ans[K]:
     ans.pop()
     break;
   ans.pop()
 
answer=ans[K-1]
print(answer)
import collections
def check(val):
  global x
  global count
  flag=1
  for v in range(2,val**.5+1):
    if(val%v==0):
      if(v in x or val//v in x):
        flag=0
        break
  if(flag):
    count+=1
n=int(input())
a=list(map(int,input().split()))
count=0
x=collections.Counter(a)
if(1 in x):
  if(x[1]==1):
    print(1)
  else:
    print(0)
else:
  for each in a:
    if(x[each]==1):
      check(each)
  print(count)
    


### FIXED CODE ###


n=int(input())
List=list(map(int,input().split()))

List.sort()
seive=[0]*(List[~0]+1)
count=0
for each in List:
    for i in range(each,List[-1]+1,each):
        seive[i]+=1
        
for each in List:
    if(seive[each]==1):
        count+=1


print(count)
x = input().split(" ")
n = int(x[0])
k = int(x[1])
count = 0

for b in range(1, n+1):
    p = n/b
    r = n % b
    count += p*max(0, b-k)
    count += max(0, r-k+1)
    
print(count)


### FIXED CODE ###

x = input()
y = input()
z = input()
print(x[0]+y[1]+z[2])
A,B,K=map(int, raw_input().split())
l=range(A,B+1)

if len(l)/2>=K:
	for i in l[:K]:
		print i
	for i in l[-1*K:]:
		print i
elif len(l)/2<K and K<len(l):
	for i in l[:K]:
		print i
	for i in l[ K-len(l):]:
		print i
else:
	for i in l:
		print i


### FIXED CODE ###

A,B,K=map(int, raw_input().split())
c=set()
for i in range(A,min(B+1,A+K)):
	c.add(i)

for i in range(B,max(A-1,B-K),-1):
	c.add(i)


a=list(c)
a.sort()
for i in a:
	print i
n=raw_input()
a=[]
for i in range(n):
   a.append(int(raw_input()))
print '%d %d %d' %(min(a), max(a), sum(a))

### FIXED CODE ###

n=input()
a=map(int,raw_input().split())
print "%d %d %d" % (min(a), max(a), sum(a))
#!/usr/bin/python3
# abc060_b
"""
Choose Integers
"""

from math import gcd  # greatest common divisor, 最大公約数
test = False

def lcm(x, y):
    """
    最小公倍数 least common multiple
    """
    return (x * y) // gcd(x, y)

def answer():
    """
    Aの倍数の中に条件を満たすものがあるか調べる。
    """
    A, B, C = map(int, input().split())
    upper_limit = int(lcm(A, B) / A)
    if test:
        print(lcm(A, B), upper_limit)

    for i in range(1, upper_limit+1):
        if (A * i) % B == C:
            if test:
                print(A * i)
            return 'YES'
    return 'NO'


def main():
    """
    main関数
    """
    print(answer())


if __name__ == '__main__':
    main()


### FIXED CODE ###

#!/usr/bin/python3
# abc060_b
"""
Choose Integers
"""

test = False


def answer():
    """
    Aの倍数の中に条件を満たすものがあるか調べる。
    """
    A, B, C = map(int, input().split())

    for i in range(1, A*B+1):
        if (A * i) % B == C:
            if test:
                print(A * i)
            return 'YES'
    return 'NO'


def main():
    """
    main関数
    """
    print(answer())


if __name__ == '__main__':
    main()
s=input()
n=len(s)
print(max([n-i for i in range(0,n//2,2) if  s[:(n-i)//2]==s[(n-i)//2:-i]]))

### FIXED CODE ###

s=input()
n=len(s)
print(max([n-i for i in range(2,n,2)if s[:(n-i)//2]==s[(n-i)//2:-i]]))
N,M = map(int,input().split())
path = [[] for _ in range(N*3+3)]
for _ in range(M):
    u,v = map(int,input().split())
    path[u].append(v+N)
    path[u+N].append(v+N+N)
    path[u+N+N].append(v)

S,T = map(int,input().split())
import collections

q = collections.deque()
vis = [10**10 for _ in range(N*3+3)]
def bfs():
    while len(q) > 0:
        now = q.popleft()
        #print(now,T,cnt,path[now],q)
        vis[now] = min(vis[now],cnt)
        if now == T: 
            return cnt
        for x in path[now]:
            if vis[x] == 10**10:
                q.append((x,cnt+1))
vis[S] = 1
q.append([S,0])
ans = bfs()
if vis[T] == 10**10: print(-1)
else: print(ans//3)




### FIXED CODE ###

N,M = map(int,input().split())
import time
start_t = time.time()
path = [[] for _ in range(N+3)]
for _ in range(M):
    u,v = map(int,input().split())
    path[u].append(v)

S,T = map(int,input().split())
import collections

q = collections.deque()
vis = [[-1 for _ in range(3)] for _ in range(N+3)]
vis[S][0] = 1
q.append([S,0])
while len(q):
    now,cnt = q.popleft()
    step = cnt % 3
    for x in path[now]:
        if vis[x][(step+1)%3] < 0:
            vis[x][(step+1)%3] = cnt
            q.append((x,cnt+1))

if vis[T][0] == -1:
    print(-1)
else:
    print(vis[T][0]//3+1)
x,k,d=map(int,input().split())
x=abs(x)

semin=x//d #最小に行くための個数
if semin%2==0:
  minb=0 #最小に行くための個数が偶数
else:
  minb=1 #最小に行くための個数が奇数

if semin>k:
  print(abs(x-k*d))
else:
  k=k-semin
  if k%2==0:
    ans=0 #偶数
  else:
    ans=1 #奇数
  if ans==0:#ｋが偶数の時
    if minb==0:
      print(abs(x-d*semin))
    else:
      print(min(abs((x-(d*semin))-d),abs(x-d*semin)))
  else:#ｋが奇数の時
    if minb==0:
      print(abs((x-(d*semin))-d))
    else:
      print(abs(x-d*semin))  

### FIXED CODE ###

s=input()
count=0
if s.count('R')==1:
  print(1)
elif s.count('R')==3:
  print(3)
elif s.count('R')==2:
  if s[1]=="R":
    print(2)
  else:
    print(1)
else:
  print(0)
# -*- coding: utf-8 -*-

s = list(input())
t = list(input())
a = []

for i in range(len(t)-1,len(s)):
    lock = True
    for j in range(len(t)):
        if s[i-len(t)+j+1] == "?":
            pass
        elif s[i-len(t)+j+1] != t[j]:
            lock = False
    if lock:
        a.append(s[:i-len(t)+1] + t[:])

if len(a) == 0:
    print("UNRESTORABLE")
else:
    a.sort()
    for i in range(len(a[0])):
        if a[0][i] == "?":
            a[0][i] = "a"

answer = "".join(a[0])

print(answer)


### FIXED CODE ###

S = list(input())
T = list(input())
LS = len(S)
LT = len(T)
a = ""
for i in reversed(range(LS - LT + 1)):
    for j in range(LT):
        if S[i + j] != T[j] and S[i + j] != "?":
            break
        if j == LT - 1:
            for k in range(LT):
                S[i + k] = T[k]
            #print("".join(S))
            s = str("".join(S)).replace("?", "a")
            print(s)
            exit()
# S = S.replace("?", "a")
print("UNRESTORABLE")
def tax(p,x):
    return p*(100+x) // 100 # 整数除算

def solve(X,Y,S):
    ans = 0
    oldsum = 0
    newsum = 0
    for a in range(1,S):
        for b in range(1,S-a+1): #税抜き価格a,bの総和はS以下である
            oldsum = tax(a,X)+tax(b,X) #税制改定前の税込合計額
            if oldsum == S: # 新税でのtax(a,Y)+tax(b,Y) について検討 
                newsum = tax(a,Y)+tax(b,Y) 
                if newsum > ans:
                    ans =newsum
            if oldsum > S:
                break # b増加ならばsum増加のため
    return ans

while True:
    X,Y,S = map(int, input().split())
    if a == 0:
        break
    print(solve(X,Y,S))


### FIXED CODE ###

def tax(p,x):
    return p*(100+x) // 100 # 整数除算

def solve(X,Y,S):
    ans = 0
    oldsum = 0
    newsum = 0
    for a in range(1,S):
        for b in range(1,S-a+1): #税抜き価格a,bの総和はS以下である
            oldsum = tax(a,X)+tax(b,X) #税制改定前の税込合計額
            if oldsum == S: # 新税でのtax(a,Y)+tax(b,Y) について検討 
                newsum = tax(a,Y)+tax(b,Y) 
                if newsum > ans:
                    ans =newsum
            if oldsum > S:
                break # b増加ならばsum増加のため
    return ans

while True:
    X,Y,S = map(int, input().split())
    if X == 0:
        break
    print(solve(X,Y,S))
n,m=map(int,input().split())
a=[]
b=[]
C=[]
s=[0 for i in range(n)]
s[0] = "Yes"

for i in range(m):
  a,b=map(int,input().split())

def Next(be):
  C.clear()
  for j in be:
    for i in range(len(a)):
      if len(a) <= i:
        break
      if a[i] == j:
        
        if s[b[i]-1]==0 and 0 == be.count(b[i]):
          C.append(b[i])
          s[b[i]-1]=j
        continue
      if b[i] == j:
        
        if s[a[i]-1]==0 and 0 == be.count(a[i]):
          C.append(a[i])
          s[a[i]-1]=j
        continue
  return C
co=[1]

while True:
  if s.count(0) == 0:
    break
  co = Next(list(co))

for i in s:
  print(i)

### FIXED CODE ###

from collections import deque

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

graph = [[] for _ in range(N + 1)]
for i in range(M):
  graph[a[i]].append(b[i])
  graph[b[i]].append(a[i])

    # bfs
queue = deque([1])
signposts = [0] * (N + 1)
signposts[1] = 1
while queue:#キューが空になるまで
  u = queue.popleft()
  for v in graph[u]:
    if not signposts[v]:
      signposts[v] = u
      queue.append(v)
 
if all(signposts[2:]):
  print("Yes")
  print("\n".join(map(str, signposts[2:])))
else:
  print("No")