Harryxun/stf_run huggingface dataset:
import fractions
import collections
import copy

n = int(input())
ai = [int(i) for i in input().split()]

num = 10**5

mod = 10**9+7

if n == 1:
    print(1)
    exit()

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

pri_li = []

for i in range(n):
    pri_li.append(collections.Counter(prime_factorize(ai[i])))

com_ab = [0]*(num)

for i in range(n):
    #print(len(b_li[i]))
    keys = pri_li[i].keys()
    #print(keys)
    for j in keys:
        com_ab[j] = max(com_ab[j],pri_li[i][j])

"""
for i in range(10**3):
    if com_ab[i] > 0:
        com_num *= pow(i,com_ab[i],mod)
"""
ans = 0

for i in range(n):
    com_ab_new = copy.deepcopy(com_ab)
    #print(com_ab,com_ab_new)
    keys = pri_li[i].keys()
    for j in keys:
        com_ab_new[j] -= pri_li[i][j]
    kari = 1
    for j in range(num):
        if com_ab_new[j] > 0:
            kari *= pow(j,com_ab_new[j],mod)
    ans += kari
    ans %= mod
    #print(ans)
        
print(ans)


### FIXED CODE ###

import collections
import math
n = int(input())
ai = [int(i) for i in input().split()]

mod = 10**9+7

if n == 1:
    print(1)
    exit()
    
    
# 素因数分解、辞書で返すやつ
# mathをimportする
def prime(n):
    factor = {}
    tmp = int(math.sqrt(n)) + 1
    for num in range(2, tmp):
        while n % num == 0:
            n //= num
            if not num in factor.keys():
                factor[num] = 1
            else:
                factor[num] += 1
        if num > n:
            break
    if n != 1:
        if not n in factor.keys():
            factor[n] = 1
        else:
            factor[n] += 1
    return factor


dic = {}
for a in ai:
    pr = prime(a)
    for num, count in pr.items():
        if not num in dic.keys():
            dic[num] = count
        else:
            if dic[num] < count:
                dic[num] = count

kari = 1
for num,count in dic.items():
    kari *= pow(num,count,mod)
    kari %= mod

kari_old = kari
ans = 0

for i in range(n):
    kari = kari_old
    #com_ab_new = copy.deepcopy(com_ab)
    #print(com_ab,com_ab_new)
    #kari = 1
    #for j in range(kosu):
    #kari *= pow(sosu_li[j][0],com_ab[sosu_li[j][0]],mod)
    kari *= pow(ai[i],mod-2,mod)
    ans += kari
    ans %= mod
    #print(ans)
    #print(ans)
        
print(ans)
a = input()
if 0 <= ord(a) - ord('a') <= 26:
  return 'a'
if 0 <= ord(a) - ord('A') <= 26:
  return 'A'

### FIXED CODE ###

a = input()
if a.islower():
  print('a')
if a.isupper():
  print('A')
import math

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

N = int(input())
T = []
for i in range(0, N):
    T.append(input())

ans = 1
for value in range(0, N):
    ans = lcm(ans, int(T[value]))

print(str(ans))

### FIXED CODE ###

def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

def lcm(x, y):
    return (x * y) // gcd(x, y)

N = int(input())
T = [int(input()) for i in range(N)]

ans = 1
for value in range(0, N):
    ans = lcm(ans, T[value])

print(ans)
#input_f = "3 4 5\n2 1 2\n6 3 4\n1 1 1\n1 2 3"
while():
    input_f = input()

    counter = [0, 0, 0]

    def t_check(a,b,c):
        if a + b > c:
            if b + c > a:
                if a + c > b: return True
        return False



    def f_check(a_, b_, c_):
        tmp = []
        tmp.append(a_)
        tmp.append(b_)
        tmp.append(c_)
        sqrts = []
        for i in range(3):
            sqrts.append(tmp[i]**2)
        m = max(sqrts)
        s = sum(sqrts)

        print(m,s)

        if m == (s - m): return(0)
        if m > (s - m): return(2)
        if m < (s - m): return(1)


    t = input_f.split("\n")[i].split()
    fn, sn, tn = int(t[0]),int(t[1]),int(t[2])
    if t_check(fn,sn,tn):
        counter[f_check(fn,sn,tn)] += 1
    else: break
    

print(sum(counter),counter[0], counter[1], counter[2])

        



### FIXED CODE ###

def t_check(a,b,c):
    if a + b > c:
        if b + c > a:
            if a + c > b: return True
    return False

def f_check(a_, b_, c_):
    tmp = []
    tmp.append(a_)
    tmp.append(b_)
    tmp.append(c_)
    sqrts = []
    for i in range(3):
        sqrts.append(tmp[i]**2)
    m = max(sqrts)
    s = sum(sqrts)

    if m == (s - m): return(0)
    if m > (s - m): return(2)
    if m < (s - m): return(1)
    
counter=[0,0,0]
    
while(1):
    input_f = input()

    t = input_f.split()
    fn, sn, tn = int(t[0]),int(t[1]),int(t[2])
    if t_check(fn,sn,tn):
        counter[f_check(fn,sn,tn)] += 1
    else: break
    
print(sum(counter),counter[0], counter[1], counter[2])
line = input().split()
x = int(line[1])
ans = 0
 
a = sorted(input().split())
map(int, a)
 
for i in range(len(a)):
  if a[i] > x:
    print(ans)
    break
  else:
    x-=a[i]
    if i!=len(a)-1:
      ans+=1
    else:
      if x==0:
        ans+=1
      print(ans)

### FIXED CODE ###

line = input().split()
N = int(line[0])
x = int(line[1])
ans = 0

a = input().split()
a = [int(i) for i in a]
a.sort()

for i in range(N):
    if a[i] > x:
        print(ans)
        break
    else:
        x -= a[i]
        if i != (N - 1):
            ans += 1
        else:
            if x == 0:
                ans += 1
            print(ans)
N, H = map(int, input().split())
A, B = zip(*[tuple(map(int, input().split())) for _ in range(N)])
a = max(A)
B = sorted((b for b in B if b > a), reverse=True)
for i in range(len(B)):
    H -= B[i]
    if H <= 0:
        break
else:
    i += (H + a - 1) // a
i += 1
print(i)

### FIXED CODE ###

N, H = map(int, input().split())
A, B = zip(*[tuple(map(int, input().split())) for _ in range(N)])
a = max(A)
B = sorted((b for b in B if b > a), reverse=True)
for i, b in enumerate(B, 1):
    H -= b
    if H <= 0:
        ans = i
        break
else:
    ans = len(B) + (H + a - 1) // a
print(ans)
import math
import sys

n=int(input())

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

if d[0]!=0 or 0 in d[1:]:
    print(0)
    sys.exit()

lis=[0 for i in range(n)]

for i in range(n):
    lis[d[i]]+=1

s=1

i=0
while lis[i+1]!=0:
    s=(s*pow(lis[i],lis[i+1],998244353))%998244353
    i+=1
print(s)

### FIXED CODE ###

import math
import sys

n=int(input())

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

if d[0]!=0 or 0 in d[1:]:
    print(0)
    sys.exit()

lis=[0 for i in range(n)]

for i in range(n):
    lis[d[i]]+=1

for i in range(1,n-1):
    if lis[i]==0 and lis[i+1]!=0:
        print(0)
        sys.exit()
s=1

i=0
while i+1<=n-1 and lis[i+1]!=0:
    s=(s*pow(lis[i],lis[i+1],998244353))%998244353
    i+=1
print(s)
n = int(input())
s = [_ for _ in input()]

l, r = 0, n-1
if not('R' in s):
    print(0)
    exit()

if not('W' in s):
    print('0')
    exit()

ans = 0
while 1:
    while s[l] == 'W':
        l += 1

    while s[r] == 'R' and l < r:
        r -= 1

    ans += 1

    if l > r:
        break

    l += 1
    r -= 1
print(ans)


### FIXED CODE ###

n = int(input())
s = [_ for _ in input()]

l, r = 0, n-1
if not('R' in s):
    print(0)
    exit()

if not('W' in s):
    print('0')
    exit()

ans = 0
while 1:
    while s[l] == "R":
        l += 1
    while s[r] == "W" and l != r:
        r -= 1

    if l != r:
        s[l], s[r] = s[r], s[l]
        ans += 1
        # print(s)
    if l == r:
        break

print(ans)
r, c = [int(i) for i in input().split()]

data = []
sum_row = [0] * (c + 1)

for ri in range(r):
    data[ri].append([int(i) for i in input().split()])
    data[ri].append(sum(data[ri]))
    print(" ".join([str(d) for d in data[ri]]))
    for ci in range(c + 1):
        sum_row[ci] += data[ri] [ci]
print(" ".join([str(s) for s in sum_row]))

### FIXED CODE ###

r, c = [int(i) for i in input().split()]

data = []
sum_row = [0] * (c + 1)

for ri in range(r):
    data.append([int(i) for i in input().split()])
    data[ri].append(sum(data[ri]))
    print(" ".join([str(d) for d in data[ri]]))
    for ci in range(c + 1):
        sum_row[ci] += data[ri][ci]
print(" ".join([str(s) for s in sum_row]))
import math
import itertools

n = int(input())
k = int(input())

f = len(str(n))

#f-1桁以内に収まる数

en = 1
for i in range(k):
    en *= f-1-i

de = math.factorial(k)


s = en // de * pow(9, k)

#print(s)
#f桁目によって絞る

kami = int(str(n)[0])

en_2 = 1
for i in range(k-1):
    en_2 *= f-1-i

de_2 = math.factorial(k-1)


s += (en_2 // de_2 * pow(9, k-1)) * (kami-1)


#以下上1桁は同じ数字

keta = list(range(f-1))
num = list(range(1,10))

b =  kami * pow(10, f-1)
m = 0

if k == 1:
    s += 1
elif k == 2:
    s += 9*(f-2) + int(str(n)[1])
else:
    kami2 = int(str(n)[1])

    en_3 = (f-2)*(f-3)

    de_3 = 2


    s += (en_3 // de_3 * pow(9, k-1))  + kami2 * 9 * (f-2)

print(s)

### FIXED CODE ###

import math
import itertools

n = int(input())
k = int(input())

f = len(str(n))

if f < k:
    print(0)
else:
    #f-1桁以内に収まる数

    en = 1
    for i in range(k):
        en *= f-1-i

    de = math.factorial(k)


    s = en // de * pow(9, k)


    #f桁目によって絞る

    kami = int(str(n)[0])

    en = 1
    for i in range(k-1):
        en *= f-1-i

    de = math.factorial(k-1)


    s += (en // de * pow(9, k-1)) * (kami-1)


    #以下上1桁は同じ数字

    keta = list(range(f-1))
    num = list(range(1,10))

    b =  kami * pow(10, f-1)
    m = 0


    if k == 1:
        m = b
        if m <= n:
            s += 1
    else:
        for d in itertools.product(num, repeat=k-1):
            for c in itertools.combinations(keta, k-1):
                m = b
                for i in range(k-1):
                    m +=  d[i] * pow(10, c[i])
                if m <= n:
                    s += 1

    print(s)
w, h, n = list(map(int, input().split()))
xya = []
for i in range(n):
    xya.append(list(map(int, input().split())))

min_x_1 = w
max_x_2 = 0
min_y_3 = h
max_y_4 = 0
for i in range(n):
    ai = xya[i][2]
    if ai == 1:
        if xya[i][0] < min_x_1:
            min_x_1 = xya[i][0]
    if ai == 2:
        if xya[i][0] > max_x_2:
            max_x_2 = xya[i][0]
    if ai == 3:
        if xya[i][1] < min_y_3:
            min_y_3 = xya[i][1]
    if ai == 4:
        if xya[i][1] > max_y_4:
            max_y_4 = xya[i][1]

x = min_x_1 - max_x_2
if x <= 0:
    print("0")
else:
    y = min_y_3 - max_y_4
    if y <= 0:
        print("0")
    else:
        print(str(x * y))
return 0


### FIXED CODE ###

w, h, n = list(map(int, input().split()))
xya = []
for i in range(n):
    xya.append(list(map(int, input().split())))

max_x_1 = 0
min_x_2 = w
max_y_3 = 0
min_y_4 = h
for i in range(n):
    ai = xya[i][2]
    if ai == 1:
        if xya[i][0] > max_x_1:
            max_x_1 = xya[i][0]
    if ai == 2:
        if xya[i][0] < min_x_2:
            min_x_2 = xya[i][0]
    if ai == 3:
        if xya[i][1] > max_y_3:
            max_y_3 = xya[i][1]
    if ai == 4:
        if xya[i][1] < min_y_4:
            min_y_4 = xya[i][1]

x = min_x_2 - max_x_1
if x <= 0:
    print("0")
else:
    y = min_y_4 - max_y_3
    if y <= 0:
        print("0")
    else:
        print(x * y)
from sys import stdin

n = int(stdin.readline().rstrip())
xs = [int(x) for x in stdin.readline().rstrip().split()]
ys = [int(x) for x in stdin.readline().rstrip().split()]

count = 0

for i in range(n):
   r = min(xs[i], ys[i])
   xs[i] -= r
   ys[i] -= r
   count += r
   r = min(xs[i+1], ys[i])
   xs[i+1] -= r
   count += r
   
print(count)

### FIXED CODE ###

from sys import stdin

A, B = [int(x) for x in stdin.readline().rstrip().split()]

if (A + B) % 2 == 0:
    print((A + B) // 2)
else:
    print('IMPOSSIBLE')
import math


def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))


N, K = map(int, input().split())
mod = int(1e+9 + 7)
for i in range(1, K+1):
    print(int(combinations_count(N-K+1, i) * combinations_count(K-1, i-1) % mod))


### FIXED CODE ###

import math


def combinations_count(n, r):
    if n >= r:
        return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
    else:
        return 0


N, K = map(int, input().split())
mod = int(1e+9 + 7)
for i in range(1, K+1):
    print(int(combinations_count(N-K+1, i) * combinations_count(K-1, i-1) % mod))
N, M = map(int, input().split())
A = list(map(int, input().split()))
d = {}
for a in A:
    if not a in d: d[a] = 0
    d[a] += 1
for i in range(M):
    B, C = map(int, input().split())
    if not C in d: d[C] = 0
    d[C] += B
T = sorted(d.items(), key=lambda x:x[0], reverse=True)
B = []
for t in T:
    B.extend([t[0]] * t[1])
    if len(B) >= N: break
print(sum(B[:N]))


### FIXED CODE ###

N, M = map(int, input().split())
A = list(map(int, input().split()))
d = {}
for a in A:
    if not a in d: d[a] = 0
    d[a] += 1
for i in range(M):
    B, C = map(int, input().split())
    if not C in d: d[C] = 0
    d[C] += B
T = sorted(d.items(), key=lambda x:x[0], reverse=True)
ans = 0
cnt = 0
for t in T:
    if t[1] <= N - cnt:
        ans += t[0] * t[1]
        cnt += t[1]
    else:
        ans += t[0] * (N - cnt)
        break
print(ans)
n = int(innput())

if n in 7:
  print("Yes")
  else:
  print("No")

### FIXED CODE ###

n = str(input())
m = "7"
if m in n:
  print("Yes")
else:
  print("No")
if chokudai == chokudai:
  print('no')
elif:
  print('yes')
  

### FIXED CODE ###

S = input()
T = input()
if T[0:-1] == S:
  print('Yes')
else:
  print('No')
n = int(input())
as = list(map(int,input().split()))

ans = 1

for i in as:
    ans *= i
    ans = min(i, 10*18+1)
    if ans <= 10**18+1:
        print(-1)

else:
    print(ans)

### FIXED CODE ###

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

ans = 1

for i in As:
    ans *= i
    ans = min(ans, 10**18 + 1)

if ans == 10**18 + 1:
    print(-1)

else:
    print(ans)
s = list(input())
acgt = ['A', 'C', 'G', 'T']
cnt = 0
i, j = 0, 0
maxv = 0

for j in range(len(s)):
  maxv = max(maxv, cnt)
  cnt = 0
  while s[j] in acgt:
    cnt += 1
    j += 1
maxv = max(maxv, cnt)
print(maxv)

### FIXED CODE ###

s=input()
clist=['A','C','G','T']
count=0
a=[]
for i in s:
  if i in clist:
    count+=1
  else:
    a.append(count)
    count=0
a.append(count)
print(max(a))
N = int(raw_input())
max = 0
min = 0
for i in range(N):
    R.append(int(raw_input()))

min = R[0]
max = R[1]
dif = R[1] - R[0]
for i in range(N - 1):
    if R[i+1] > max:
        max = R[i+1]
        dif = max - min
    if R[i] < min:
        min = R[i]
        dif = max - min

print dif

### FIXED CODE ###

N = int(raw_input())
min = int(raw_input())
max = int(raw_input())
dif = max - min
if max < min:
    min = max

for i in range(N - 2):
    R = int(raw_input())
    if R - min > dif:
        dif = R - min
    if R < min:
        min = R

print dif
import math

a, b = map(int, input().split())
for i in range(1, 101):
    if a == math.floor(i * 0.08):
        for j in range(1, 101):
            if b == math.floor(j * 0.1):
                if i == j:
                    break
        else:
            continue
        break
else:
    print(-1)
print(j)


### FIXED CODE ###

a, b = map(int, input().split())
for i in range(1, 1001):
    if a == int(i * 0.08) and b == int(i * 0.1):
        print(i)
        break
else:
    print(-1)
import sys
input = lambda: sys.stdin.readline().rstrip('\r\n')

from collections import defaultdict

N = int(input())

S = 'RULD'

class Plane:
	__slots__ = ('x', 'y', 'd')

	def __init__(s, x, y, d):
		s.x, s.y, s.d = int(x), int(y), d

	def __lt__(s, o):
		return s.x < o.x

	def rotate(s):
		s.x, s.y = -s.y, s.x
		s.d = S[(S.index(s.d)+1)%4]


P = [Plane(*input().split()) for _ in range(N)]

INF = 10 ** 18
best = INF
MAXC = 200000

for trial in range(4):
	P.sort()

	rdu, rdd, ry = ([INF] * (2*MAXC+1) for _ in range(3))

	for p in P:
		if p.d == 'R':
			ry[p.y+MAXC] = p.x
			rdu[p.y-p.x+MAXC] = p.x
			rdd[p.y+p.x+MAXC] = p.x
		elif p.d == 'L':
			ty = p.y + MAXC
			if ry[ty] != INF:
				best = min(best, (p.x - ry[ty]) * 5)
		elif p.d == 'U':
			ty = p.x + p.y + MAXC
			if rdd[ty] != INF:
				best = min(best, (p.x - rdd[ty]) * 10)
		elif p.d == 'D':
			ty = p.y - p.x + MAXC
			if rdu[ty] != INF:
				best = min(best, (p.x - rdu[ty]) * 10)

	if trial != 3:
		for p in P: p.rotate()

print('SAFE' if best == INF else best)


### FIXED CODE ###

import sys
input = lambda: sys.stdin.readline().rstrip('\r\n')

from collections import defaultdict

N = int(input())

S = 'RULD'

class Plane:
	__slots__ = ('x', 'y', 'd')

	def __init__(s, x, y, d):
		s.x, s.y, s.d = int(x), int(y), d

	def __lt__(s, o):
		return s.x < o.x

	def rotate(s):
		s.x, s.y = -s.y, s.x
		s.d = S[(S.index(s.d)+1)%4]

P = []
for _ in range(N):
	x, y, d = input().split()
	P.append((int(x), int(y), d))

def rotate(s):
	return (-s[1], s[0], S[(S.index(s[2])+1)%4])

INF = 10 ** 18
best = INF
MAXC = 400000

for trial in range(4):
	P.sort(key=lambda v: v[0])

	rdu, rdd, ry = ([INF] * (2*MAXC+1) for _ in range(3))

	for (x, y, d) in P:
		if d == 'R':
			ry[y+MAXC] = x
			rdu[y-x+MAXC] = x
			rdd[y+x+MAXC] = x
		elif d == 'L':
			ty = y + MAXC
			if ry[ty] != INF:
				best = min(best, (x - ry[ty]) * 5)
		elif d == 'U':
			ty = x + y + MAXC
			if rdd[ty] != INF:
				best = min(best, (x - rdd[ty]) * 10)
		elif d == 'D':
			ty = y - x + MAXC
			if rdu[ty] != INF:
				best = min(best, (x - rdu[ty]) * 10)

	if trial != 3:
		P = [rotate(p) for p in P]

print('SAFE' if best == INF else best)
a=int(input())
b="Christmas"
for i in range(25-a)
	b+=" Eve"
  print(b)

### FIXED CODE ###

a=int(input())
b="Christmas"
for i in range(25-a):
	b+=" Eve"
print(b)
function Main(input) {
  input = input.split("\n");
  var N = parseInt(input[0]);
  var edge = new Array(N);
  var dp = new Array(N);
  var mod = Math.pow(10,9)+7;
  for(var i=0;i<N-1;i++){
      tmp = input[i+1].split(" ").map(i => parseInt(i));
      if(edge[tmp[0]-1]==undefined){
        edge[tmp[0]-1]=[];
      }
      if(edge[tmp[1]-1]==undefined){
        edge[tmp[1]-1]=[];
      }
      edge[tmp[0]-1].push(tmp[1]-1);
      edge[tmp[1]-1].push(tmp[0]-1);
  }
  var flag=new Array(N).fill(0);
  if(N!=1){
    flag[0]=1;
    for(var i=0;i<N;i++){
      if(edge[i].length==1){
        dp[i]=[1,1];
        flag[i]=1;
      }else{
        dp[i]=[0,0];
      }
    }
    dp[0]=[0,0];
    var stack = [0];

    while(stack.length!=0){
      var term=0;
      var white=1;
      var black=1;
      var length=stack.length-1;
      for(var i=0;i<edge[stack[length]].length;i++){
        if(flag[edge[stack[length]][i]]==0){
          flag[edge[stack[length]][i]]=1;
          stack.push(edge[stack[length]][i]);
          term=1;
        }else{
          var sub1=Math.max(1,(dp[edge[stack[length]][i]][0]+dp[edge[stack[length]][i]][1])%mod);
          var sub2=Math.max(1,dp[edge[stack[length]][i]][0])
          white=(white*sub1)%mod;
          black=(black*sub2)%mod;
        }
      }
      if(term==0){
        dp[stack[length]]=[white,black];
        stack.pop();
      }
    }
    var ans=(dp[0][0]+dp[0][1])%mod;
  }else{
    var ans=2;
  }
  console.log('%s', ans);
  return ans;
}
// "実行する"ボタンを押した時に実行される関数 (デバッグ用)
function debug(n){
  var input = document.getElementById("input"+n).value;
  var ans=Main(input);
  var result="WA";
  if(ans==document.getElementById("output"+n).value.split("\n")[0]){
    result="AC";
  }
  document.getElementById("result"+n).innerHTML=result;
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

### FIXED CODE ###

import sys
input = sys.stdin.readline

MOD=10**9+7
 
n=int(input())
edge=[[] for _ in range(n)]
for _ in range(n-1):
  p,q = [int(i)-1 for i in input().split()]
  edge[p].append(q)
  edge[q].append(p)

flag=[0]*n
flag[0]=1
if n==1:
  ans=2
else:
  dp=[[0] * 2 for i in range(n)]
  for i in range(n):
    if len(edge[i])==1:
      dp[i]=[1,1]
      flag[i]=1
    else:
      dp[i]=[0,0]
  dp[0]=[0,0]
  stack = [0]
  while len(stack)!=0:
    term=0
    white=1
    black=1
    length=len(stack)-1
    for i in range(len(edge[stack[length]])):
      if flag[edge[stack[length]][i]]==0:
        flag[edge[stack[length]][i]]=1
        stack.append(edge[stack[length]][i])
        term=1
      else:
        sub1=max(1,(dp[edge[stack[length]][i]][0]+dp[edge[stack[length]][i]][1])%MOD)
        sub2=max(1,dp[edge[stack[length]][i]][0])
        white=(white*sub1)%MOD
        black=(black*sub2)%MOD
    if term == 0:
      dp[stack[length]]=[white,black]
      stack.pop()
  
  ans = (dp[0][0]+dp[0][1])%MOD

print(ans)
n = int(input())
s = input()
if n % 2 == 1:
  print("No")
else:
  s1 = s[:n/2+1]
  s2 = s[n/2+1:]
  if s1 == s2:
    print("Yes")
  else:
    print("No")

### FIXED CODE ###

n = int(input())
s = input()
if n % 2 == 1:
  print("No")
else:
  s1 = s[:(n//2)]
  s2 = s[(n//2):]
  if s1 == s2:
    print("Yes")
  else:
    print("No")
def data_input():
    a,b,c,d = input().split(' ')
    a = int(a)
    b = int(b)
    c = int(c)
    d = int(d)
    return (a,b,c,d)
def answer():
    a,b,c,d = data_input()
    s = '1974'
    return a in s and b in s and c in s and d in s
answer()

### FIXED CODE ###

def data_input():
    a,b,c,d = input().split(' ')
    return (a,b,c,d)
def answer():
    a,b,c,d = data_input()
    s = '1974'
    s = s.replace(a,'').replace(b,'').replace(c,'').replace(d,'')
    if len(s) == 0:
        print('YES')
    else:
        print('NO')
answer()
n = int(input())
x = int(input(),2)
bitx = bin(x).count('1')
 
ans = [0]*(bitx+1)
for i in range(1,bitx+1):
    ans[i] = 1 + ans[i%bin(i).count('1')]
#print(ans)
l = []
bitp = bitx + 1
bitm = bitx - 1
xmp = x % bitp
xmm = x % bitm
if bitx != 1:
    for i in range(n):
        if x>>(n-i-1)&1:
            xm = (xmm - pow(2,n-i-1)) % bitm
            l.append(str(1+ans[xm]))
        else:
            xm = (xmp + pow(2,n-i-1))%bitp
            l.append(str(1+ans[xm]))

else:
    for i in range(n):
        if x>>(n-i-1)&1:
            l.append(str(0))
        else:
            xm = (xmp + pow(2,n-i-1))%bitp
            l.append(str(1+ans[xm]))

print('\n'.join(l))


### FIXED CODE ###

n = int(input())
X = input()
x = int(X,2)
bitx = bin(x).count('1')
 
ans = [0]*(bitx+2)
for i in range(1,bitx+2):
    ans[i] = 1 + ans[i%bin(i).count('1')]
#print(ans)
l = []
bitp = bitx + 1
bitm = bitx - 1
xmp = 0
xmm = 0


if bitx != 1:
    for i in range(n):
        if X[i] == '1':
            xmp += pow(2, n-(i+1), bitp)
            xmm += pow(2, n-(i+1), bitm)
    for i in range(n):
        if X[i] == '1':
            xm = (xmm - pow(2,n-i-1,bitm)) % bitm
            l.append(str(1+ans[xm]))
        else:
            xm = (xmp + pow(2,n-i-1,bitp))%bitp
            l.append(str(1+ans[xm]))
 
else:
    for i in range(n):
        if X[i] == '1':
            xmp += pow(2, n-(i+1), bitp)
    for i in range(n):
        if X[i] == '1':
            l.append(str(0))
        else:
            xm = (xmp + pow(2,n-i-1,bitp))%bitp
            l.append(str(1+ans[xm]))
 
print('\n'.join(l))
from collections import deque

def bfs(s):
  q = deque([s])
  d[s] = 1
  while q:
    node = q.popleft()
    for i in ab[node]:
      if d[i] == 0:
        d[i] = node + 1
        q.append(i)

n,m = map(int, input().split())
ab = [[] for _ in range(n)]
for _ in range(n):
  a,b = map(lambda x: int(x)-1, input().split())
  ab[a].append(b)
  ab[b].append(a)
  
d = [0]*n
bfs(0)
if all(d[1:]):
  print("Yes")
  print(*d[1:], sep="\n")
else: print("No")

### FIXED CODE ###

from collections import deque

def bfs(graph, n, s):
  visited = [0]*n
  visited[s] = 1
  q = deque([s])
  while q:
    node = q.popleft()
    for i in graph[node]:
      if not visited[i]:
        visited[i] = node + 1
        q.append(i)
  return visited

n,m = map(int, input().split())
graph = [[] for _ in range(n)]
for _ in range(m):
  a,b = map(lambda n: int(n)-1, input().split())
  graph[a].append(b)
  graph[b].append(a)
visited = bfs(graph, n, 0)[1:]
if all(visited):
  print("Yes")
  print(*visited, sep="\n")
else:
  print("No")