Harryxun/stf_run huggingface dataset:
import numpy as np
from numba import njit, i8, jitclass
import sys

spec = [
    ("size", i8),
    ("tree", i8[:])
]


@jitclass(spec)
class Bit:
    def __init__(self, n, arr):
        self.size = n
        self.tree = np.array([0] + arr, np.int64)
        for i in range(1, n+1):
            self.tree[i + (i & -i)] += self.tree[i]

    def sum(self, i):
        s = 0
        while i > 0:
            s += self.tree[i]
            i -= i & -i
        return s

    def add(self, i, x):
        while i <= self.size:
            self.tree[i] += x
            i += i & -i

    def range_sum(self, l, r):
        return self.sum(r) - self.sum(l)


def main():
    n, q = map(int, sys.stdin.buffer.readline().split())
    bit = Bit(n, list(map(int, sys.stdin.buffer.readline().split())))
    for x in sys.stdin.buffer.readlines():
        q, p, x = map(int, x.split())
        if q:
            print(bit.range_sum(p, x))
        else:
            bit.add(p+1, x)


if __name__ == "__main__":
    main()


### FIXED CODE ###

import sys


class Bit:
    def __init__(self, n):
        self.size = n
        self.tree = [0] * (n + 1)

    def sum(self, i):
        s = 0
        while i > 0:
            s += self.tree[i]
            i -= i & -i
        return s

    def add(self, i, x):
        while i <= self.size:
            self.tree[i] += x
            i += i & -i


def main():
    n, q = map(int, sys.stdin.buffer.readline().split())
    bit = Bit(n)
    a = list(map(int, sys.stdin.buffer.readline().split()))
    for i in range(n):
        bit.add(i+1, a[i])
    for x in sys.stdin.buffer.readlines():
        q, p, x = map(int, x.split())
        if q:
            print(bit.sum(x) - bit.sum(p))
        else:
            bit.add(p+1, x)


if __name__ == "__main__":
    main()
# ABC075B

import numpy as np

h, w = map(int, input().split())
board = sp.reshape(np.array(sp.repeat("@", (h+2)*(w+2))), (h+2, w+2))
for i in range(h):
    s = input()
    board[i+1, 1:w+1] = np.array(list(s))
for i in range(1, h+1):
    count = np.zeros(w, dtype=str)
    for j in range(1, w+1):
        if board[i,j] == '.':
            count[j-1] = str(\
                (board[i-1, j-1] == "#") + (board[i-1, j] == "#") + (board[i-1, j+1] == "#") +\
                (board[i  , j-1] == "#") + (board[i  , j] == "#") + (board[i  , j+1] == "#") +\
                (board[i+1, j-1] == "#") + (board[i+1, j] == "#") + (board[i+1, j+1] == "#"))
        elif board[i, j] == "#":
            count[j-1] = "#"
    print(''.join(count))


### FIXED CODE ###

# ABC075B

import numpy as np

h, w = map(int, input().split())
board = np.reshape(np.array(np.repeat("@", (h+2)*(w+2))), (h+2, w+2))
for i in range(h):
    s = input()
    board[i+1, 1:w+1] = np.array(list(s))
for i in range(1, h+1):
    count = np.zeros(w, dtype=str)
    for j in range(1, w+1):
        if board[i,j] == '.':
            count[j-1] = str(\
                (board[i-1, j-1] == "#") + (board[i-1, j] == "#") + (board[i-1, j+1] == "#") +\
                (board[i  , j-1] == "#") + (board[i  , j] == "#") + (board[i  , j+1] == "#") +\
                (board[i+1, j-1] == "#") + (board[i+1, j] == "#") + (board[i+1, j+1] == "#"))
        elif board[i, j] == "#":
            count[j-1] = "#"
    print(''.join(count))
'''
    Auther: ghoshashis545 Ashis Ghosh
    College: jalpaiguri Govt Enggineerin College
    Date:24/03/2020
'''
from math import ceil,sqrt,log,gcd
def ii():return int(input())
def si():return input()
def mi():return map(int,input().split())
def li():return list(mi())
def main():
    
    # for _ in range(ii()):
    
    a=li()
    if(len(set(a))==2):
        print('Yes')
    else:
        print('No')
        
















    
    
if __name__ =="__main__":
    main()

### FIXED CODE ###

'''
    Auther: ghoshashis545 Ashis Ghosh
    College: jalpaiguri Govt Enggineerin College
    Date:24/03/2020
'''

def main():
    
    # for _ in range(ii()):
    
    a=list(map(int,input().split()))
    if(len(set(a))==2):
        print('Yes')
    else:
        print('No')
        
















    
    
if __name__ =="__main__":
    main()
import bisect
n=int(input())
al=list(map(int,input().split()))
tl=al[:]
for i in range(1,n):
    tl[i]=(tl[i-1]+tl[i])
ta=bisect.bisect_left(tl,tl[-1]/2)
print(abs(al[ta+1]-al[ta]))

### FIXED CODE ###

n=int(input())
al=list(map(int,input().split()))
sm=sum(al)
t=0
ans=10**15
for i in range(n-1):
    t+=al[i]
    ans=min(ans,abs(sm-t*2))
print(ans)
N = int(input())
a = list(int(i) for i in input().split())
for i in range(N):
  a[i] = a[i]-i
a.sort()
if N%2==0:
  b=int((a[int(N/2)]+a[int(N/2+1)])/2)
else:
  b=a[int((N+1)/2)]
sum_1=0
sum_2=0
for i in range(N):
  sum_1 += abs(a[i]-b)
b-=1
for i in range(N):
  sum_2 += abs(a[i]-b)
print(min(sum_1,sum_2))


### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
A = [x - i - 1 for i, x in enumerate(A)]
A.sort()
mid = A[N // 2]
res1 = 0
for a in A:
    res1 += abs(a - mid)

mid += 1
res2 = 0
for a in A:
    res2 += abs(a - mid)


print(min(res1, res2))
n = int(input())
AB = [list(map(int, input().split())) for _ in range(n)]
AB.sort(reverse = True, key = lambda x:x[0]+x[1])
ans = sum(AB[0::2][0]) - sum(AB[1::2][1])
print(ans)

### FIXED CODE ###

n = int(input())
AB = [list(map(int, input().split())) for _ in range(n)]
AB.sort(reverse = True,key = lambda x:x[0]+x[1])
ans = 0
for i in range(n):
    if i % 2 == 0:
        ans += AB[i][0]
    else:
        ans -= AB[i][1]
print(ans)
import sys

chash = {}
for i in range( ord( 'a' ), ord( 'z' ) ):
	chash[ chr( i ) ] = 0


line = sys.stdin.readlines().rstrip()
for i in range( len( line ) ):
	if line[i].isalpha():
		chash[ line[i].lower() ] += 1

for i in range( ord( 'a' ), ord( 'z' ) ):
	print( "{:s} : {:d}".format( chr( i ), chash[ chr( i ) ] ) )
	

### FIXED CODE ###

import sys
 
chash = {}
for i in range( ord( 'a' ), ord( 'z' )+1 ):
    chash[ chr( i ) ] = 0
 
while True:
    line = sys.stdin.readline().rstrip()
    if not line:
        break
    for i in range( len( line ) ):
        if line[i].isalpha():
            chash[ line[i].lower() ] += 1
 
for i in range( ord( 'a' ), ord( 'z' )+1 ):
    print( "{:s} : {:d}".format( chr( i ), chash[ chr( i ) ] ) )
l = [2, 1]
for x in xrange(100):
    l.append(l[-2] + l[-1])
print l[input()]

### FIXED CODE ###

from itertools import groupby
if [len(list(e)) for k, e in groupby(raw_input()) if len(list(e)) >= 3]:
    print 'Yes'
else:
    print 'No'
n = int(input())

num_list = []
for i in range(n):
    a = int(input())
    num_list.append(a)

num_list.sort()
num_list2 = []
i = 0
while i < n:
    if num_list[i] == num_list[i+1]:
        i += 2
    else:
        num_list2.append(num_list[i])
        i += 1

print(len(num_list2))

### FIXED CODE ###

n = int(input())

num_list = []
for i in range(n):
    a = int(input())
    num_list.append(a)

num_list.sort()
num_list2 = []
i = 0
while i < n:
    if i == n-1:
        num_list2.append(num_list[i])
        break
    elif num_list[i] == num_list[i+1]:
        i += 2
    else:
        num_list2.append(num_list[i])
        i += 1


print(len(num_list2))
X,Y=map(int,input().split);
print(int(X+Y/2));


### FIXED CODE ###

X,Y=map(int,input().split())
print(int(X+Y/2))
a=input()
s=input()
if a >= 3200:
  print(s)
else:
  print("red")

### FIXED CODE ###

a=int(input())
s=input()
if a >= 3200:
  print(s)
else:
  print("red")
N=int(input())
A=list(map(int,input().split()))

num=[0]*N
for i in A:
    num[i-1]+=1

for j in range(len(num)):
    print(num[j])

### FIXED CODE ###

import numpy as np
print(float(input())*2*np.pi)
import sys
input = sys.stdin.readline

D = int(input())
cost = list(map(int, input().split()))
S = [list(map(int, input().split())) for _ in range(D)]

last_held = [-1 for i in range(26)]
ans = []
for date, daily_scores in enumerate(S):
    minus_score = 0
    for i in range(D):
        minus_score += cost[i] * (date - last_held[i])

    max_score = daily_scores[0] + cost[0] * (date - last_held[0])
    max_index = 0
    for i, dayly_score in enumerate(daily_scores):
        tmp = daily_scores[i] + cost[i] * (date - last_held[i])
        if max_score < tmp:
            max_index = i
            max_score = tmp
    last_held[max_index] = date
    ans.append(max_index+1)
print("\n".join(map(str, ans)))


### FIXED CODE ###

import sys
input = sys.stdin.readline

D = int(input())
cost = list(map(int, input().split()))
S = [list(map(int, input().split())) for _ in range(D)]

last_held = [-1 for i in range(26)]
ans = []
for date, line in enumerate(S):
    max_score = line[0] - cost[0]*last_held[0]
    max_index = 0
    for i, score in enumerate(line):
        tmp = score - cost[i]*last_held[i]
        if max_score < tmp:
            max_index = i
            max_score = tmp
    last_held[max_index] = date
    ans.append(max_index+1)
print("\n".join(map(str, ans)))
Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 bit (AMD64)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> 
======= RESTART: C:\Users\mori-\OneDrive\Desktop\Python\abc\tenka1a.py =======
Traceback (most recent call last):
  File "C:\Users\mori-\OneDrive\Desktop\Python\abc\tenka1a.py", line 13, in <module>
    print(gcd_list(a))
  File "C:\Users\mori-\OneDrive\Desktop\Python\abc\tenka1a.py", line 9, in gcd_list
    for i in range(len(n)):
NameError: name 'n' is not defined
>>> 
======= RESTART: C:\Users\mori-\OneDrive\Desktop\Python\abc\tenka1a.py =======
None

======= RESTART: C:\Users\mori-\OneDrive\Desktop\Python\abc\tenka1a.py =======
6

======= RESTART: C:\Users\mori-\OneDrive\Desktop\Python\abc\tenka1a.py =======
6

======= RESTART: C:\Users\mori-\OneDrive\Desktop\Python\abc\tenka1a.py =======
3

======= RESTART: C:\Users\mori-\OneDrive\Desktop\Python\abc\tenka1a.py =======
3 7
9 3 4
Traceback (most recent call last):
  File "C:\Users\mori-\OneDrive\Desktop\Python\abc\tenka1a.py", line 19, in <module>
    if A[-1] > k and (A[-1] - k) % gcd_lst(A) == 0:
NameError: name 'gcd_lst' is not defined
>>> 
======= RESTART: C:\Users\mori-\OneDrive\Desktop\Python\abc\tenka1a.py =======
3 7
9 3 4
POSSIBLE
>>> 
======= RESTART: C:\Users\mori-\OneDrive\Desktop\Python\abc\tenka1a.py =======
3 5
6 9 3
IMPOSSIBLE
>>> 
======= RESTART: C:\Users\mori-\OneDrive\Desktop\Python\abc\tenka1a.py =======
4 11
11 3 7 15
POSSIBLE
>>> 
======= RESTART: C:\Users\mori-\OneDrive\Desktop\Python\abc\tenka1a.py =======
5 12
10 2 8 6 4
IMPOSSIBLE
>>> 

### FIXED CODE ###

def gcd(a, b):
    if  b == 0:
        return a
    else:
        return gcd(b, a % b)

def gcd_list(a):
    x = a[0]
    for i in range(len(a)):
        x = gcd(a[i], x)
    return x
        

n, k = map(int, input().split())
A = list(map(int, input().split()))

ans = 'IMPOSSIBLE'
A.sort()
if A[-1] >= k and (A[-1] - k) % gcd_list(A) == 0:
    ans = 'POSSIBLE'

print(ans)
a = int(input())
b = int(input())
c = int(input())

if c - (a - b) >= 0:
    print(c - (a - b))
else:
    print(0)

### FIXED CODE ###

a, b, c = map(int, input().split(" "))

if c - (a - b) >= 0:
    print(c - (a - b))
else:
    print(0)
h,w = map(int,input().split())
a = [list(input()) for nesya in range(h)]
b = [['.']*w for motsu in range(h)]
b[0][0] = '#'
j = 0
for i in range(h):
  if j < w:
    while a[i][j+1] == '#':
      j += 1
      b[i][j] = '#'
      if j == w-1:
        break
  if i+1 < h:
    b[i+1][j] = '#'

if a == b:
  print('Possible')
else:
  print('Impossible')

### FIXED CODE ###

h,w = map(int,input().split())
a = [list(input()) for nesya in range(h)]
c = 0
for i in range(h):
  for j in range(w):
    if a[i][j] == '#':
      c += 1

if c == h+w-1:
  print('Possible')
else:
  print('Impossible')
import math
r = max(n)+1
sqrt = int(math.sqrt(r))
p = [1]*r
p[0] = 0
for i in range(1,sqrt):
    if p[i]:
        p[2*i+1::i+1] = [0 for x in range(2*i+1,r,i+1)]
  
n = int(raw_input())
for i in range(n):
    print sum(p[:n])

### FIXED CODE ###

def isPrime(p):
	if p == 2: return 1
	if p < 2 or p&1 == 0: return 0
	return 1 if pow(2,p-1,p) == 1 else 0
	
n = int(raw_input())
print sum(isPrime(int(raw_input())) for i in range(n))
N = int(input())
    T,A = [int(i) for i in input().split(' ')]
    H = [int(i) for i in input().split(' ')]
    minTemp = 600
    
    for i,h in enumerate(H):
        temp = T - h * 0.006
        if abs(temp-A) < minTemp:
            minTemp = abs(temp-A)
            place = i+1
    print(place)

### FIXED CODE ###

N = int(input())
T,A = [int(i) for i in input().split(' ')]
H = [int(i) for i in input().split(' ')]
minTemp = 600

for i,h in enumerate(H):
    temp = T - h * 0.006
    if abs(temp-A) < minTemp:
        minTemp = abs(temp-A)
        place = i+1
print(place)
N = int(input())
if N==1:
	print('Hello World')
else:
	A = int(input())
	B = int(input())
    print(A+B)

### FIXED CODE ###

N = int(input())
if N == 1:
  print('Hello World')
else:
  A = int(input())
  B = int(input())
  print(A+B)
n = int(input())
cnt = 0
for a in range(1,n):
    cnt += (n-1)//a
print(cnt)n = int(input())
cnt = 0
for a in range(1,n):
    cnt += (n-1)//a
print(cnt)

### FIXED CODE ###

n = int(input())
cnt = 0
for a in range(1,n):
    cnt += (n-1)//a
print(cnt)
from functools import lru_cache

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

@lru_cache(maxsize=None)
def rec(n):
    if n == 0:
        return 0
    elif n == 1:
        return abs(h[1]-h[0])
    return min(abs(h[n]-h[n-1]) + rec(n-1), abs(h[n]-h[n-2]) + rec(n-2))

print(rec(n-1))

### FIXED CODE ###

n = int(input())
h = list(map(int, input().split()))
res = [0] * n

res[1] = abs(h[1] - h[0])
for i in range(2, n):
    res[i] = min(res[i-2] + abs(h[i] - h[i-2]),
                 res[i-1] + abs(h[i] - h[i-1]))

print(res[-1])
k, x = map(int input().split()) 
if 500*k >= x:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

k,x=map(int,input().split())
if k*500>=x:
    print("Yes")
else:
    print("No")
N, i = map(int, inout().split())
print(N-i+1)

### FIXED CODE ###

N, i = map(int, input().split())
print(N-i+1)
#D
n,k = map(int,input().split())

MOD = 10 ** 9 + 7

from operator import mul
from functools import reduce

def nCr(n,r):
    r = min(n-r,r)
    if r == 0: 
        return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under % MOD



for i in range(1,k+1):
    a1 = nCr(n-k+1,i)
    if i > 1:
        a2 = nCr(k-1,i-1)
    else:
        a2 = 1
    print(a1*a2 % MOD)

### FIXED CODE ###

#D
n,k = map(int,input().split())

MOD = 10 ** 9 + 7

from operator import mul
from functools import reduce

def nCr(n,r):
    if n < r:
        return 0
    r = min(n-r,r)
    if r == 0: 
        return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under % MOD



for i in range(1,k+1):
    a1 = nCr(n-k+1,i)
    a2 = nCr(k-1,i-1)
    print(a1*a2 % MOD)
N=int(input())
S=input()
tmp=""
for i in range(N):
  if(S[i]!=Z):
    tmp+=chr(ord(S[i])+1)
  else:
    tmp+="A"
print(tmp)

### FIXED CODE ###

N=int(input())
S=input()
tmp=""
for i in range(len(S)):
  chtmp=ord(S[i])+N
  if(chtmp>ord('Z')):
    chtmp-=(ord('Z') - ord('A') + 1)
  tmp+=chr(chtmp)
print(tmp)
osatsu, okane = map(int, input().split())

#1万円の枚数 : x
#5千円の枚数 : y
#千円の枚数  : z

x_max = okane // 10_000

for x in range(x_max + 1):
    z_max = (okane // 1_000)
    tmp = z_max - osatsu - 9 * x
    if tmp % 4 != 0 or tmp < 0:
        continue
    y = tmp // 4
    z = osatsu - x - y
    if z < 0:
        continue

    print(x,y,z)
    break
else:
    print(-1, -1, -1)


### FIXED CODE ###

osatsu, okane = map(int, input().split())

#1万円の枚数 : x
#5千円の枚数 : y
#千円の枚数  : z

x_max = okane // 10000

for x in range(x_max + 1):
    z_max = (okane // 1000)
    tmp = z_max - osatsu - 9 * x
    if tmp % 4 != 0 or tmp < 0:
        continue
    y = tmp // 4
    z = osatsu - x - y
    if z < 0:
        continue

    print(x,y,z)
    break
else:
    print(-1, -1, -1)
n, k = map(int, input().split())
 
p = list(map(int, input().split()))
s_max = 0

p = [(e+1) / 2 for e in p]

for i in range(n-k+1):
  s = sum(p[i:i+k])
  if s_max < s:
    s_max = s
    
print(e)

### FIXED CODE ###

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

m = [(e + 1) / 2 for e in p]

t = sum(m[0:K])
result = t
for i in range(N - K):
    t -= m[i]
    t += m[i + K]
    if t > result:
        result = t
print(result)
from sys import exit
from collections import deque
# import copy
# import numpy as np
# from collections import deque

n, m, k = map(int, input().split())
a = deque(list(map(int, input().split())))
b = deque(list(map(int, input().split())))

cnt = 0

while k >= a[0] or k >= b[0]:
    if a[0] < b[0]:
        k -= a.popleft()
        cnt += 1

    elif a[0] > b[0]:
        k -= b.popleft()
        cnt += 1

    else:
        for i in range(1, min(len(a), len(b))+1):
            if a[i] < b[i]:
                for t in range(0, i+1):
                    k -= a.popleft()
                    cnt += 1
                    if k < a[0]:
                        break
                break
            elif a[i] > b[i]:
                for t in range(0, i+1):
                    k -= b.popleft()
                    cnt += 1
                    if k < b[0]:
                        break
                break
        else:
            if len(a) > len(b):
                for i in range(len(a)):
                    k -= a.popleft()
                    if k < a[0]:
                        break
            else:
                for i in range(len(b)):
                    k -= b.popleft()
                    cnt += 1
                    if k < b[0]:
                        break
    if a == deque([]):
        for i in range()
        k -= b.popleft()
        cnt += 1
        if
        break
    if b == deque([]):
        while k >= a[0]:
            k -= a.popleft()
            cnt += 1
        break
print(cnt)


### FIXED CODE ###

from sys import exit
import copy
# import numpy as np
from collections import deque

n, m, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

cnt = 0


a.insert(0, 0)
b.insert(0, 0)


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

for i in range(1, m+1):
    b[i] += b[i-1]

tmp = m
for i in range(n+1):
    for j in range(tmp, -1, -1):
        if a[i] + b[j] <= k:
            cnt = max(cnt, i + j)
            tmp = j
            break


print(cnt)
s=input()
sl=list(reversed(s))
ns="".join(list(reversed(s)))
k=(len(s)-1)/2
t=s[:k]
tl=list(reversed(t))
nt="".join(list(reversed(t)))
n=(len(s)+3)/2
r=s[n-1:len(s)]
rl=list(reversed(r))
nr="".join(rl)
if s==ns and t==nt and r==nr:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

s=input()
sl=list(reversed(s))
ns="".join(list(reversed(s)))
k=int((len(s)-1)/2)
t=s[:k]
tl=list(reversed(t))
nt="".join(list(reversed(t)))
n=int((len(s)+3)/2)
r=s[n-1:len(s)]
rl=list(reversed(r))
nr="".join(rl)
if s==ns and t==nt and r==nr:
    print("Yes")
else:
    print("No")
A,B = map(int,input().split())
a = format(A-1,'b')
b = format(B,'b')
if a < 0:
  a = 0
le = len(b)
part = []
whole = []
for i in range(1,le+1):
  whole += [int(b[i-1])]
  df = le - len(a)
  if i <= df:
    part += [0]
  else:
    part += [int(a[i-1-df])]
p = 0
for i in range(le):
  p *= 10
  if i == le-1:
    if int(a)%4 == 1 or int(a)%4 == 2:
      p += 1
  elif part[i] == 0:
    pass
  else:
    p += 1- int(a)%2
w = 0
for i in range(le):
  w *= 10
  if i == le-1:
    if int(b)%4 == 1 or int(b)%4 == 2:
      w += 1
  elif whole[i] == 0:
    pass
  else:
    w += 1- int(b)%2
print(int(str(w),2)^int(str(p),2))

### FIXED CODE ###

a,b = map(lambda x:
          int(format(int(x),'b')),input().split())
a -= 1
A = str(a)
la = len(A)
ga = [0]*la
if a%4 == 1 or a%4 == 2:
  ga[-1] = 1
for ai in range(0,la-1):
  if A[ai] == '1' and A[-1] == '0':
    ga[ai] = 1
aa = 0
for ai in range(la):
  aa *= 2
  aa += ga[ai]
B = str(b)
lb = len(B)
gb = [0]*lb
if b%4 == 1 or b%4 == 2:
  gb[-1] = 1
for bi in range(0,lb-1):
  if B[bi] == '1' and B[-1] == '0':
    gb[bi] = 1
bb = 0
for bi in range(lb):
  bb *= 2
  bb += gb[bi]
if a < 0:
  print(bb)
else:
  print(aa^bb)
#d
m,n=map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(m)]
maze = []
inf = 9999999
dist = [inf]* n
dist[0] = 0
queue = []
answer = [0]*n

goto = [[] * 1 for i in range(n)]
for i in range(len(ab)):
    goto[ab[i][0]-1].append(ab[i][1]-1)
    goto[ab[i][1]-1].append(ab[i][0]-1)

queue.extend([0])

while queue != []:
    go = queue.pop()
    for h in goto[go]:
        if dist[h] == inf:
            queue.append(h)
            dist[h] = dist[go]+1
            answer[h] =go+1
print("yes")
for i in answer[1:]:
    print(i)

### FIXED CODE ###

#d
n,m=map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(m)]
maze = []
inf = 9999999
dist = [inf]* n
dist[0] = 0
queue = []
answer = [0]*n

goto = [[] * 1 for i in range(n)]
for i in range(len(ab)):
    goto[ab[i][0]-1].append(ab[i][1]-1)
    goto[ab[i][1]-1].append(ab[i][0]-1)

queue.extend([0])

while queue != []:
    go = queue.pop(0)
    for h in goto[go]:
        if dist[h] == inf:
            queue.append(h)
            dist[h] = dist[go]+1
            answer[h] =go+1
            

            
print("Yes")
for i in answer[1:]:
    print(i)
N = int(input())
S = input()
l = len(N)
if l % 2 == 1:
  ans = 0
else:
  ans = (S[:l//2] == S[l//2:])
if ans:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
     
def main():
    N = I()
    t = S()
    if N % 2 > 0:
        print('No')
        return
    if t[:N//2] == t[N//2:]:
        print('Yes')
    else:
        print('No')

main()
num = input()

print(num **3)

### FIXED CODE ###

num = int(input())

print(num ** 3)
N=input()
Nstring=str(N)
i=0
S=0#各桁の輪
while i<len(Nstring):
    S+=int(Nstring[i])
    i+=1

if N%S==0:
    print("Yes")
else:
    print("No")


### FIXED CODE ###

N=int(input())
Nstring=str(N)
i=0
S=0#各桁の輪
while i<len(Nstring):
    S+=int(Nstring[i])
    i+=1

if N%S==0:
    print("Yes")
else:
    print("No")
# ===================================
# (c) MidAndFeed aka ASilentVoice
# ===================================
# import math 
# import collections
# import string
# ===================================
n = int(input())
q = [int(x) for x in input().split()]
ans = [None for _ in range(n)]
ans[0] = 0

# Top down
def dp(current):
	if ans[current] != None: return ans[current]

	if current < 0: return 0
	else:
		t1 = t2 = int(1e9)
		if current-1 >= 0: t1 = abs(q[current] - q[current-1]) + dp(current-1)
		if current-2 >= 0: t2 = abs(q[current] - q[current-2]) + dp(current-2)

		ans[current] = min(t1, t2)
		return ans[current]

dp(n-1)
print(ans[n-1])


### FIXED CODE ###

# ===================================
# (c) MidAndFeed aka ASilentVoice
# ===================================
# import math 
# import collections
# import string
# ===================================
n = int(input())
q = [int(x) for x in input().split()]
ans = [None for _ in range(n)]
ans[0] = 0

# # Top down
# def dp(current):
# 	if ans[current] != None: return ans[current]

# 	if current < 0: return 0
# 	else:
# 		t1 = t2 = int(1e9)
# 		if current-1 >= 0: t1 = abs(q[current] - q[current-1]) + dp(current-1)
# 		if current-2 >= 0: t2 = abs(q[current] - q[current-2]) + dp(current-2)

# 		ans[current] = min(t1, t2)
# 		return ans[current]

# dp(n-1)

for i in range(1, n):
	t1 = t2 = int(1e9)
	if i-1 >= 0: t1 = ans[i-1] + abs(q[i-1] - q[i])
	if i-2 >= 0: t2 = ans[i-2] + abs(q[i-2] - q[i])
	ans[i] = min(t1, t2)
# print(ans)
print(ans[n-1])