Harryxun/stf_run huggingface dataset:
import math
from heapq import heappush, heappop

n, m = map(int, input().split(' '))

a = list(map(int, input().split(' ')))

h = []

for i in a:
    heappush(h, -i)

for i in range(m):
    v = heappop(h)
    heappush(h, -(-v // 2))
    print(h)

print(-sum(h))

### FIXED CODE ###

import math
from heapq import heappush, heappop

n, m = map(int, input().split(' '))

a = list(map(int, input().split(' ')))

h = []

for i in a:
    heappush(h, -i)

for i in range(m):
    v = heappop(h)
    heappush(h, -(-v // 2))

print(-sum(h))
X,Y=map(int,input().split())
if X==Y:
  print('=')
elif X<Y:
  print('<')
else:
  print('>')

### FIXED CODE ###

X,Y=input().split()
if X==Y:
  print('=')
elif X<Y:
  print('<')
else:
  print('>')
a=input()
print(a**3)
if __name__ == "__main__":
    sys.exit(main())

### FIXED CODE ###

a=int(input())
print(a**3)
N, L = map(int, input().split())
S = [input() for s in range(N)]
S.sort()
output = ""
for i in S:
  output+=i
prunt(output)

### FIXED CODE ###

n, l = map(int, input().split())
s = sorted(input() for _ in range(n))
print(*s, sep="")
d,t,s=intput().split()
d=int(d)
t=int(t)
s=int(s)
d1=s*t
if d<=d1:
  print("Yes")
else:
  print("No")


### FIXED CODE ###

d,t,s=input().split()
d=int(d)
t=int(t)
s=int(s)
d1=s*t
if d<=d1:
  print("Yes")
else:
  print("No")
r=(int,input())
a=3(rxr)

### FIXED CODE ###

r=int(input())
a=3*(r*r)
print(a)
a,b,c = map(int, input(),split())

if a < b < c:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

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

if a < b < c:
    print("Yes")
else:
    print("No")
n = int(input())
inp = map(int,input().split())
inp.reverse()
for i in range(n-1):
	print(inp[i]," ",sep="",end="")

### FIXED CODE ###

n = int(input())
inp = list(map(int,input().split()))
inp.reverse()
for i in range(n-1):
	print(inp[i]," ",sep="",end="")
print(inp[n-1])
import numpy as np
a, b, x = map(int,input().split())
if a * a * b * (1 / 2) >= x:   
    l = (2 * x) / (a * b)  
else:
    l = (2 * (a * a * b - x)) / (a * b)
print(180 / np.pi * np.arctan(b / l))

### FIXED CODE ###

import numpy as np
a, b, x = map(int,input().split())
if x == 0:
    print(90)
elif a * a * b * (1 / 2) >= x:   
    l = (2 * x) / (a * b)
    print(180 / np.pi * np.arctan(b / l))
else:
    l = (2 * (a * a * b - x)) / (a * a)
    print(180 / np.pi * np.arctan(l / a))
(a == b or a > b or a < b )

### FIXED CODE ###

a,b = input().split()
a = int(a)
b = int(b)
 
if a == b:
    print('a == b')
elif a < b:
    print('a < b')
else :
    print('a > b')
R, C, K = map(int, input().split())
a = [[0]*C for _ in range(R)]
dp = [[[0]*4 for _ in range(C)] for _ in range(R)]
for i in range(K):
    r, c, v = map(int, input().split())
    a[r-1][c-1] = v

for i in range(R):
    for j in range(C):
        for k in range(2, -1, -1):
            dp[i][j][k+1] = max(dp[i][j][k+1], dp[i][j][k]+a[i][j])
        for k in range(4):
            dp[i+1][j][0] = max(dp[i+1][j][0], dp[i][j][k])
            dp[i][j+1][k] = max(dp[i][j+1][k], dp[i][j][k])

ans = 0
for i in range(4):
    ans = max(ans, dp[R-1][C-1][i])

print(ans)



### FIXED CODE ###

r,c,k = list(map(int, input().split()))
import copy
dp=[[[0]*4 for _ in range(c)] for _ in range(2)]


F = [[0]*c for _ in range(r)]

for _ in range(k):
  x,y,v = list(map(int, input().split()))
  x-=1
  y-=1
  F[x][y] = v
  
for nn in range(r):
  for j in range(c):
    i = 1
    val = F[nn][j]
  
      
    mxv = max(dp[i-1][j][0], dp[i-1][j][1], dp[i-1][j][2], dp[i-1][j][3])

    dp[i][j][3] = max(dp[i][j-1][3], dp[i][j-1][2] + val)
    dp[i][j][2] = max(dp[i][j-1][2], dp[i][j-1][1] + val)
    dp[i][j][1] = max(dp[i][j-1][1], dp[i][j-1][0] + val, mxv + val)
    dp[i][j][0] = mxv

  dp[0] = dp[1] 
  dp[1] = [[0]*4 for _ in range(c)]

best = 0


for k in range(4):
  best = max(best, dp[0][c-1][k])
    
print(best)
s=input()
ans=[]
def two(k):
	 qq="0"*(9-len(bin(k)[2:]))+bin(k)[2:]
	 return qq

for i in range(1,2**9):
	p=""
	for j in range(9):
		if two(i)[j]=="1":
			p+="AKIHABARA"[j]
	ans.append(p)
if s in ans:
	print("YES")
else:
	print("NO")
	print(2/0)



### FIXED CODE ###

s=input()
ans=set()
def two(k):
	 qq="0"*(9-len(bin(k)[2:]))+bin(k)[2:]
	 return qq

for i in range(1,2**9):
	p=""
	for j in range(9):
		if two(i)[j]=="1":
			p+="AKIHABARA"[j]
		if "KI" in p and "H" in p and "B" in p and "R" in p:
			ans.add(p)
if s in ans:
	print("YES")
else:
	print("NO")
a,b = map(int,input().split())
b1 = 0
b2 = 0
s = 0
s1 = 0
s2 = 0
t = 0
t1 = 0
u = 0
if b>=10000:
	s = b // 10000
	b1 = b - s*10000
    if 5000<=b1<10000:
        b2 = b1 - 5000
        s1 = b2 // 1000
        if (s + 1 + s1) <= a:
            print(s,1,s1)
        else:
            print(-1,-1,-1)
elif 5000<=b<10000:
    t = b // 5000
    b1 = b - t*5000
    t1 = b1 // 1000
    if (t + t1) <= a:
        print(0,t,t1)
    else:
      print(-1,-1,-1)
elif b<5000:
    u = b // 1000
    if u <= a:
        print(0,0,u)
    else:
        print(-1,-1,-1)
    


### FIXED CODE ###

N,Y = map(int,input().split())
c = 0
for i in range(0,N+1):
    for j in range(0,N+1):
        c = ((Y-(10000*i+5000*j))/1000)
        if c.is_integer and c >= 0 and i+j+c == N:
            d = int(c)
            print(i,j,d)
            exit()
print(-1,-1,-1)
x,n = map(int,input().split())
if n != 0:
    l = list(map(int,input().split()))
else:
    print(x)
    exit()

if x not in l:
    print(x)
    exit()

tmp = []
for i in range(x-50,x+50):
    tmp.append(i)

ans = []
for j in tmp:
    if j not in l:
        ans.append(j)

tmp1 = 1
for k in ans:
    tmp2 = abs(x-k)
    if tmp2 != 0:
        if tmp1 >= tmp2:
            tmp1 = tmp2

ans2 = []
for m in ans:
    a = abs(m-x)
    if a == tmp1:
        ans2.append(m)

print(min(ans2))

### FIXED CODE ###

import sys

x,n = map(int,input().split())
if n != 0:
    l = list(map(int,input().split()))
else:
    print(x)
    sys.exit()

if x not in l:
    print(x)
    sys.exit()

tmp = []
for i in range(x-60,x+60):
    tmp.append(i)

ans = []
for j in tmp:
    if j not in l:
        ans.append(j)

tmp1 = 100
for k in ans:
    tmp2 = abs(x-k)
    if tmp2 != 0:
        if tmp1 >= tmp2:
            tmp1 = tmp2

ans2 = []
for m in ans:
    a = abs(m-x)
    if a == tmp1:
        ans2.append(m)

print(min(ans2))
l=[int(input()) for i in range(5)]
ans=[]
ans1=[]
for i in l:
    if i%10==0:
        ans+=[i]
    else:
        ans1+=[i]
ans2=[]
amari=[]
for i in ans1:
    amari+=[i%10]
    i=((i//10)+1)*10
    ans2+=[i]

amari.sort()
print(sum(ans+ans2)-(10-amari[0]))

### FIXED CODE ###

l=[int(input()) for i in range(5)]
ans=[]
ans1=[]
for i in l:
    if i%10==0:
        ans+=[i]
    else:
        ans1+=[i]
ans2=[]
amari=[]
for i in ans1:
    amari+=[i%10]
    i=((i//10)+1)*10
    ans2+=[i]

amari.sort()
print(sum(ans+ans2)-(10-amari[0]) if len(amari)!=0 else sum(ans+ans2) )
import statistics
import numpy as np

N, K = map(int, input().split())
h = [int(input()) for i in range(N)]

h.sort()
median = statistics.median(h)
idx = np.abs(np.asarray(h) - median).argmin()
result = 10 ** 9

if abs(h[idx] - h[idx-(K-1)]) < abs(h[idx+(K-1)] - h[idx]):
    result = abs(h[idx] - h[idx-(K-1)])
else:
    result = abs(h[idx+(K-1)] - h[idx])
print(result)


### FIXED CODE ###

N, K = map(int, input().split())
h = [int(input()) for i in range(N)]
h.sort()
print(min(h[i+K-1] - h[i] for i in range(N-K+1)))
def f(j):
  a[j]=1
  n=len(dic[j])
  for k in range(n):
    if a[dic[j][k]]==0:
      f(dic[j][k])

N, M=map(int, input().split())
dic={}
for i in range(1, N+1):
  dic[i]=[]

for i in range(M):
  x, y, z=map(int, input().split())
  dic[x].append(y)
  dic[y].append(x)
  
a=[0]*(N+1)
out=0
i=1
while i<N+1:
  if a[i]==0:
    a[i]=1
    out+=1
    n=len(dic[i])
    for j in range(n):
      if a[dic[i][j]]==0:
        f(dic[i][j])
  i+=1
print(out)

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**6)

def f(j):
  a[j]=1
  n=len(dic[j])
  for k in range(n):
    if a[dic[j][k]]==0:
      f(dic[j][k])

N, M=map(int, input().split())
dic={}
for i in range(1, N+1):
  dic[i]=[]

for i in range(M):
  x, y, z=map(int, input().split())
  dic[x].append(y)
  dic[y].append(x)
  
a=[0]*(N+1)
out=0
i=1
while i<N+1:
  if a[i]==0:
    a[i]=1
    out+=1
    n=len(dic[i])
    for j in range(n):
      if a[dic[i][j]]==0:
        f(dic[i][j])
  i+=1
print(out)
n=int(input())
xy=[list(map(int,input().split())) for _ in range(n)]
l=[]
for i in range(n-1):
    for j in range(i+1,n):
        l.append(math.sqrt((xy[i][0]-xy[j][0])**2 + (xy[i][1]-xy[j][1])**2))
print(sum(l)*2/n)

### FIXED CODE ###

import math
n=int(input())
xy=[list(map(int,input().split())) for _ in range(n)]
l=[]
for i in range(n-1):
    for j in range(i+1,n):
        l.append(math.sqrt((xy[i][0]-xy[j][0])**2 + (xy[i][1]-xy[j][1])**2))
print(sum(l)*2/n)
N, K = map(int, input())
# N ,K = 100000, 5

def min_v(x, k):
    v=1.0
    while v>x/k:
        v /= 2
    return v

V = 0
for n in range(1, N+1):
    V += min_v(n, K)

print('{:.16f}'.format(V/N))

### FIXED CODE ###

N, K = map(int, input().split())
# N ,K = 100000, 5

def min_v(x, k):
    v=1.0
    while v>x/k:
        v /= 2
    return v

V = 0
for n in range(1, N+1):
    V += min_v(n, K)

print('{:.16f}'.format(V/N))
n = input()
n = int(n)
maxv = -20000000
list = []

i = 0
while(i<n):
	x = input()
	x = int(x)
	list = list.append(x)
	i = i + 1

minv = list[0]
i = 1
while(i<n):
	maxv = max(maxv, list[i]-minv)
	minv = min(minv, list[i])
	i = i + 1

print(maxv)


### FIXED CODE ###

n = input()
n = int(n)
list = []

i = 0
while(i<n):
	x = input()
	x = int(x)
	list.append(x)
	i = i + 1

maxv = -2000000000
minv = list[0]
i = 1
while(i<n):
        maxv = max(maxv, list[i]-minv)
        minv = min(minv, list[i])
        i = i + 1
	
print(maxv)
While True:
    nums= input(),split()
    a = int(nums[0])
    op = nums[1]
    b = int(nums[2])

    if op == '?':
        break

    if op == '+':
        i = a + b
        print(i)

    if op == '-':
        i = a - b
        print(i)

    if op == '*':
        i = a * b
        print(i)

    if op == '/':
        i = a / b
        round(i)
        print(i)

### FIXED CODE ###

while True:
    (a, op, b) = [int(i) if i.isdigit() else i for i in input().split()]

    if op == '?':
        break

    if op == '+':
        print(a + b)

    if op == '-':
        print(a - b)

    if op == '*':
        i = a * b
        print(a * b)

    if op == '/':
        print(a // b)
import numpy as np

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

base = np.zeros(n)
seen = np.diag(np.ones(n))
temp = 1

for i in range(m):
  a,b = map(int,input().split())
  seen[a-1] += seen[b-1]
  seen[b-1] += seen[a-1]
  
seen = np.where(seen > 0,1,0) - np.diag(np.ones(n))
ans = 0
for i in range(n):
  temp = seen[i]*h
  temp_1 = np.max(temp)
  if h[i] > temp_1:
    ans += 1
    
print(ans)

### FIXED CODE ###

import numpy as np
n,m = map(int,input().split())
h = list(map(int,input().split()))

base = np.ones(n)

for i in range(m):
  a,b =  map(int,input().split())
  if h[a-1] > h[b-1]:
    base[b-1] = 0
  elif h[a-1] < h[b-1]:
    base[a-1] = 0
  elif h[a-1] == h[b-1]:
    base[a-1] = 0
    base[b-1] = 0
    
print(int(np.sum(base)))
from collections import deque
k=int(input())
deq=deque([1,2,3,4,5,6,7,8,9])
for  in range(k):
  a=deq.popleft()
  if not a%10==0:
    deq.append(a*10+a%10-1)
  deq.append(a*10+a%10)
  if a%10==9:
    deq.append(a*10+a%10+1)
print(a)
    
  


### FIXED CODE ###

from collections import deque
K=int(input())
que=deque([1,2,3,4,5,6,7,8,9])
for i in range(K):
    a=que.popleft()
    if not a%10==0:
        que.append(a*10+a%10-1)
    que.append(a*10+a%10)
    if not a%10==9:
        que.append(a*10+a%10+1)
print(a)
N = int(input())

S = list(map(input().split()))

if "Y" in S:
    print("four")

else:
    print("three")

### FIXED CODE ###

N = int(input())

S = list(map(str,input().split()))

if "Y" in S:
    print("Four")

else:
    print("Three")
num = int(input())
if num > 2:
  input_list = [int(i) for i in input().split()] 
  sorted_list = sorted(input_list)

  count = 0
  for input, sort in zip(input_list, sorted_list):
    if input != sort:
      count += 1

  if count < 2:
    print('YES')
  else:
    print('NO')
print('NO')

### FIXED CODE ###

a, b = (int(i) for i in input().split()) 
if a == 0 or b > 10**9 or b == 0 or a == b:
  print('IMPOSSIBLE')
  
elif (a + b) % 2 != 0:
  print('IMPOSSIBLE')
else:
  x = (a + b) / 2
  print(int(x))
lst1 = list(input())
iflen(lst1) != 3:
    print("No")
    exit()
for i in ["a","b","c"]:
    if not i in lst1:
        print("No")
        exit()
print("Yes")

### FIXED CODE ###

lst1 = list(input())
if len(lst1) != 3:
    print("No")
    exit()
for i in ["a","b","c"]:
    if not i in lst1:
        print("No")
        exit()
print("Yes")
a,b,X=[int(i) for i in input().split()]
if x>=a and a+b>=x:
  print('YES')
else:
  print('NO')

### FIXED CODE ###

a,b,x=[int(i) for i in input().split()]
if x>=a and a+b>x:
  print('YES')
else:
  print('NO')
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
ls = []
for i in range(5):
    ls.append(int(input()))
ansls=[]
k = input()
for i in range(4):
    m = ls[i+1]-ls[i]
    ansls.append(m)

if max(ansls)>k:
    print(':(')
else:
    print('Yay!')

### FIXED CODE ###

#! /usr/bin/env python3
# -*- coding: utf-8 -*-
ls = []
for i in range(5):
    ls.append(int(input()))
k = int(input())
if ls[4]-ls[0] <= k:
    print('Yay!')
else:
    print(':(')
A = list(map(int, input().split())
if len(set(A))==1:
    print('No')
elif len(set(A)) == 2:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

a,b,c = map(int, input().split())
A = [a,b,c]
if len(set(A)) == 1 or len(set(A)) == 3:
    print('No')
else:
    print('Yes')
N = int(input())

count = 0
odd = []
even = []
idou = []

for a in range(2, N):
    if N % a == 0:
        if count == 0:
            odd.append(a)
            count = 1
            if N / (a * a) == 1:
                even.append(a)
                count = 0

        elif count == 1:
            even.append(a)
            count = 0
            if N / (a * a) == 1:
                odd.append(a)
                count = 1

for c in range(len(odd)):
    idou.append(odd[c] + even[len(odd)-c-1])

result = min(idou) - 2

print(result)


### FIXED CODE ###

import math

N = int(input())

sqrtN = int(math.sqrt(N))

for i in reversed(range(1, sqrtN+1)):
    if N % i == 0:
        print(int(i + N/i - 2))
        quit(0)
l, r = map(int, input().split())

i_rest = l % 2019
count_i
for i in range(l, r):
  i_rest_next = i % 2019
  if i_rest_next < i_rest:
    i_rest = i_rest_next
    count_i = i
    
min_i = i_rest

i_rest = (count_i+1) % 2019
for i in range(count_i+1, r+1):
  i_rest_next = i % 2019
  if i_rest_next < i_rest:
    i_rest = i_rest_next

min_j = i_rest

print(min_i * min_j % 2019)

### FIXED CODE ###

num = [int(i) for i in input().split()]
print(min(num[0]*num[1], num[2]))
a,b,c=map(int,input())
if a==b and b==c:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

a,b,c=map(int,input().split())
if a==b and b==c:
  print('Yes')
else:
  print('No')
N=int(input())
S=input()
count=0
for i in range(N-2):
  if S[i]=='A' and S[i+1]=='B' and S[i+2]=='C':
    count=count+1
print(count)

### FIXED CODE ###

K,X=map(int,input().split())
if 500*K>=X:
  print("Yes")
else:
  print("No")
a = map(int, input().split())
if a % 2 is 1 and b % 2 is 1:
  print('Odd')
else:
  print('Even')

### FIXED CODE ###

a, b = map(int, input().split())
if a % 2 is 1 and b % 2 is 1:
  print('Odd')
else:
  print('Even')
# ABC129 C

MOD = 10**9 + 7
n, m = map(int, input().split())
a_l = [int(input()) for _ in range(m)]

dp = [0] * (n+1)
dp[0] = 1
k = 0
if a_l[0] == 1:
    k += 1
else:
    dp[1] = 1

for i in range(2, n+1):
    if i == a_l[k]:
        k = min(k+1, m-1)
        continue
    dp[i] = (dp[i-1] + dp[i-2]) % MOD
    
print(dp[n])

### FIXED CODE ###

# ABC129 C

MOD = 10**9 + 7
n, m = map(int, input().split())
a_l = [int(input()) for _ in range(m)]

dp = [0] * (n+1)
dp[0] = 1
k = 0
if m > 0 and a_l[0] == 1:
    k = min(k+1, m-1)
else:
    dp[1] = 1

for i in range(2, n+1):
    if m > 0 and i == a_l[k]:
        k = min(k+1, m-1)
        continue
    dp[i] = (dp[i-1] + dp[i-2]) % MOD
    
print(dp[n])
from math import floor
import sys
sys.setrecursionlimit(5000000)
T = int(input())
for i in range(T):
    memo = {}
    def buy(A):
        if A < B:
            return False
        else:
            if A % B > C:
                return False
            else:
                A = floor((C-A%B)/B)*B+A%B+D
                if A not in memo:
                    memo[A] = 0
                    return buy(A)
                else:
                    return(True)
    A,B,C,D = map(int,input().split())
    if B > D:
        print("No")
    else:
        if buy(A):
            print("Yes")
        else:
            print("No")




### FIXED CODE ###

from math import floor
def gcd(a,b):
    if b == 0:
        return a
    else:
        return gcd(b,a%b)
T = int(input())
for i in range(T):
    A,B,C,D = map(int,input().split())
    if B > D or B > A:
        print("No")
    else:
        if A%B>C:
            print("No")
        else:
            d = gcd(B,D%B)
            r = (A%B)%d
            if B - d + r > C:
                print("No")
            else:
                print("Yes")
import math
n = int(input())
d = int(math.log10(n)+1)

total = 0
n = str(n)
for i in range(d):
    total += int(n[i])

if total % 9 == 0:
    print('Yes')
else:
    print('No')


### FIXED CODE ###

n = int(input())

total = 0
n = str(n)
for i in range(len(n)):
    total += int(n[i])

if total % 9 == 0:
    print('Yes')
else:
    print('No')
X, Y, A, B, C = map(int, input().split())
p = sorted(list(map(int, input().split())), reverse=True)
q = sorted(list(map(int, input().split())), reverse=True)
r = sorted(list(map(int, input().split())), reverse=True)

Red = p[:X]
Green = q[:Y]

Apple = sorted(Red + Green)
for i in range(C):
    print(Apple[i], r[i])
    if Apple[i] < r[i]:
        Apple[i] = r[i]
print(sum(Apple))

### FIXED CODE ###

import heapq

X, Y, A, B, C = map(int, input().split())
p = sorted(list(map(int, input().split())), reverse=True)
q = sorted(list(map(int, input().split())), reverse=True)
r = list(map(int, input().split()))

Red = p[:X]
Green = q[:Y]

h = sorted(Red + Green)
heapq.heapify(h)
for i in r:
    heapq.heappushpop(h, i)
print(sum(h))
input_int = lambda:int(input())
input_ints = lambda:map(int,input().split())
input_ints_list = lambda:list(input_ints())
input_str = lambda:input()
input_strs = lambda:input().split()
input_lines = lambda n,f:[f() for _ in range(n)]

import functools,fractions
import numpy as np
gcd = lambda a:functools.reduce(fractions.gcd,a) # 最大公約数（リスト）
lcm_base = lambda a,b:(a*b)//fractions.gcd(a,b) # 最小公倍数(2値)
lcm = lambda a:functools.reduce(lcm_base,a,1) # 最小公倍数(リスト)

init_dp = lambda v,n:[v]*(n)

import math
# 四捨五入はround
ceil = lambda a:math.ceil(a) # 切り上げ
floor = lambda a:math.floor(a) # 切り捨て

def solution():
    N,M = input_ints()
    As = input_ints_list()
    w = [0,2,5,5,4,5,6,3,7,6]

    dp = init_dp(-1,N+1)
    dp[0] = 0
    for i in range(N+1):
        for v in As:
            if i+w[v] < N+1:
                dp[i+w[v]] = max(dp[i+w[v]],dp[i]*10+v)
    print(dp[N])
    
if __name__ == '__main__':
    solution()

### FIXED CODE ###

# 入力
input_int = lambda:int(input())
input_ints = lambda:map(int,input().split())
input_str = lambda:input()
input_strs = lambda:input().split()
input_lines = lambda n,f:[f() for _ in range(n)]

import functools,fractions
import numpy as np
gcd = lambda a:functools.reduce(fractions.gcd,a) # 最大公約数（リスト）
lcm_base = lambda a,b:(a*b)//fractions.gcd(a,b) # 最小公倍数(2値)
lcm = lambda a:functools.reduce(lcm_base,a,1) # 最小公倍数(リスト)

def solution():
    N = input_int()
    As = input_ints()
    ans = gcd(As)
    print(ans)

if __name__ == '__main__':
    solution()
N = int(input())
S = input()

if N % 2 != 0:
    print("No")
else:
    a = S[0;N/2]
    b = S[N/2;]
    if a == b:
        print("Yes")
    else:
        print("No")

### FIXED CODE ###

N = int(input())
S = input()

if N % 2 != 0:
    print("No")
else:
    a = S[:N//2]
    b = S[N//2:]
    if a == b:
        print("Yes")
    else:
        print("No")
def main():
    n, m, *ab, = map(int, open(0).read().split())

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

    def f(x):
        if p[x] < 0:
            return x
        else:
            return f(p[x])

    ans = -1
    for i, j in zip(ab[::2], ab[1::2]):
        if i > j:
            i, j = j, i

        pi, pj = f(i), f(j)
        if pi == pj:
            continue
        p[pi] += p[pj]
        ans = min(ans, p[pi])
        p[j] = pi
        p[pj] = pi

    print(-ans)


if __name__ == '__main__':
    main()


### FIXED CODE ###

def main():
    n, m, *ab, = map(int, open(0).read().split())
    p = [-1] * (n + 1)

    def find(x):
        while p[x] > 0:
            x = p[x]
        return x

    def union(i, j):
        pi, pj = find(i), find(j)
        if pi == pj:
            return
        if p[pi] < p[pj]:
            pi, pj = pj, pi
            i, j = j, i
        p[pi] += p[pj]
        p[pj] = pi
        reconnect(j, pi)

    def reconnect(i, j):
        while p[i] > 0:
            k = p[i]
            p[i] = j
            i = k

    for i, j in zip(ab[::2], ab[1::2]):
        union(i, j)

    print(-min(p))


if __name__ == '__main__':
    main()
d = input().split()
t,s = map(int,input().split())

if d − s*t < 0:
  print('Yes')
else print('No')

### FIXED CODE ###

d,t,s = map(int,input().split())
if (d - s*t <= 0):
  print('Yes')
else:
  print('No')
import numpy as np
(n, m) = list(map(int, input().split()))
a = np.array(list(map(int, input().split()))).astype("int64") 
a = np.cumsum(a)
a %= m
count = np.sum(a == 0)
(unique, counts) = np.unique(a, return_counts=True) 
counts = np.array(counts).astype("int64")
counts = counts * (counts - 1) // 2
print(count + np.sum(counts))

### FIXED CODE ###

import numpy as np
(n, m) = list(map(int, input().split()))
a = np.array(list(map(int, input().split()))).astype("int64") 
a = np.cumsum(a)
a %= m
count = np.sum(a == 0)
a.sort()
tc = 1
for i in range(1, n):
    if a[i - 1] == a[i]:
        tc += 1
    else:
        count += tc * (tc - 1) // 2
        tc = 1
else:
    count += tc * (tc - 1) // 2
print(count)
s = input()
k = int(input())
c = 1
i = 1
l = []
c2 = 0
while i < len(s):
    if i == len(s)-1:
        if s[i] == s[i-1]:
            c = c+1
            l.append(c)
            i = i+1
        else:
            l.append(c)
            l.append(1)
            i = i+1
    elif s[i] == s[i-1]:
        c = c + 1
        i = i + 1
    else:
        l.append(c)
        c = 1
        i = i+1
if len(l) == 1:
    print((len(s)*k)//2)
elif s[0] == s[len(s)-1]:
    for i in range(1,len(l)-1):
        c2 = c2 + l[i]//2
    print(c2*k+((l[0]+l[len(l)-1])//2)*(k-1)+l[0]//2+l[len(l)-1]//2)
else:
    for i in range(0,len(l)):
        c2 = c2 + l[i]//2
    print(c2*k)



### FIXED CODE ###

s = input()
k = int(input())
c = 1
i = 1
l = []
c2 = 0
while i < len(s):
    if i == len(s)-1:
        if s[i] == s[i-1]:
            c = c+1
            l.append(c)
            i = i+1
        else:
            l.append(c)
            l.append(1)
            i = i+1
    elif s[i] == s[i-1]:
        c = c + 1
        i = i + 1
    else:
        l.append(c)
        c = 1
        i = i+1
if len(l) == 1:
    print((len(s)*k)//2)
elif s[0] == s[len(s)-1]:
    if len(s)==1:
        print(k//2)
    else:
        for i in range(1,len(l)-1):
            c2 = c2 + l[i]//2
        print(c2*k+((l[0]+l[len(l)-1])//2)*(k-1)+l[0]//2+l[len(l)-1]//2)
else:
    for i in range(0,len(l)):
        c2 = c2 + l[i]//2
    print(c2*k)
C = map(str, input().split())
if "2" in c:
    print("No")
else:
    print("Yes")

### FIXED CODE ###

C = map(str, input().split())
if "2" in C:
    print("No")
else:
    print("Yes")
n, a = map(int, input().split())

if n % 500:
  if (n % 500) <= a:
    print("Yes")
  else:
    print("No")
    
else:
    print("Yes")

### FIXED CODE ###

n = int(input())
a = int(input())

if n % 500:
  if (n % 500) <= a:
    print("Yes")
  else:
    print("No")
else:
    print("Yes")