Harryxun/stf_run huggingface dataset:
s=input()ß
s=list(s)
a=list('keyence')
for i in range(8):
    if s[:i]==a[:i] and s[i-7:]==a[i-7:]:
        print('YES')
        quit()
print('NO')

### FIXED CODE ###

s=input()
s=list(s)
a=list('keyence')
for i in range(8):
    if s[:i]==a[:i] and s[i-7:]==a[i-7:]:
        print('YES')
        quit()
print('NO')
print('Yes') if input().sorted()<input().sorted(reversed=True) else:print('No')

### FIXED CODE ###

print('Yes'if sorted(input())<sorted(input(),reverse=1)else'No')
import sys
import numpy as np

s = sys.stdin.readlines()
n,m = map(int,s[0].split())
a = []
b = []
l = np.array([])
ans = 0
count = 0

for i in range(1,n+1):
	a_dash,b_dash = map(int,s[i].split())
	a.append(a_dash)
	b.append(b_dash)

c = zip(a,b)
c = sorted(c)
a,b = zip(*c)
#a = list(a)
#b = list(b)
a_length = len(a)

for i in reversed(range(m)):
	for j in range(count,a_length):
		if a[j] + i == m:
			l = np.append(l,b[j])
			count += 1
		else:
			break
	print(l)
	if l.shape[0] != 0:
		maximum = np.max(l)
		maximum_index = np.argmax(l)
		ans += maximum
		l = np.delete(l,maximum_index)

print(int(ans))


### FIXED CODE ###

import sys
import heapq

s = sys.stdin.readlines()
n,m = map(int,s[0].split())
a = []
b = []
l = []
ans = 0
count = 0

for i in range(1,n+1):
	a_dash,b_dash = map(int,s[i].split())
	a.append(-a_dash)
	b.append(-b_dash)

c = zip(a,b)
c = sorted(c,reverse=True)
a,b = zip(*c)
a_length = len(a)

for i in reversed(range(m)):
	for j in range(count,a_length):
		if -a[j] + i == m:
			heapq.heappush(l,b[j])
			count += 1
		else:
			break
	if len(l) != 0:
		maximum = heapq.heappop(l)
		ans += maximum

print(-ans)
W,H,x,y=input().split( )
answer=W*H/2
q=0
if x*2==W and y*2==H:
    q=1
else:
    q=0

print(answer,q)

### FIXED CODE ###

W,H,x,y=input().split( )
answer=int(W)*int(H)/2
q=0
if int(x)*2==int(W) and int(y)*2==int(H):
    q=1
else:
    q=0

print(answer,q)
s = int(input())
print s

### FIXED CODE ###

s = int(input())
print(pow(s,3))
N,K=map(int,input().split())

array=map(int,input().split())

A=list(array)
A.insert(0,0)

visit=0
root=[]
visited=1
once=0
while True:
    if visit & (0b1<<visited):
        break
    root.append(visited)
    visit|=0b1<<visited
    once+=1
    visited=A[visited]

roop=root[root.index(visited):]
if K<=once:
    print(root[K])
else:
    order=K-once
    print(roop[order%len(roop)])

### FIXED CODE ###

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

array=map(int,input().split())

A=list(array)
A.insert(0,0)

visit=0
root=[]
visited=1
once=0
while True:
    if visit & (0b1<<visited):
        break
    root.append(visited)
    visit|=0b1<<visited
    once+=1
    visited=A[visited]

roop=root[root.index(visited):]
if K<once:
    print(root[K])
else:
    order=K-once
    print(roop[order%len(roop)])
b = int(input())
if a%500 < b:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

a = int(input())
b = int(input())
if a%500 <= b:
    print('Yes')
else:
    print('No')
a, op, b = input().split()

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

### FIXED CODE ###

a, o, b = input().split()

if o == "+":
  print(int(a) + int(b))
elif o == "-":
  print(int(a) - int(b))
n=int(input())
lst=[]
for i in range(0,n):
    ele=int(input())
    lst.append(ele)

for i in range(0,n):
    if lst[i]%2==0:
        if lst[i]%3==0 or lst[i]%5==0:
            print("APPROVED")
        else:
            print("DENIED")

### FIXED CODE ###

n=int(input())
check=list(map(int,input().split()))
f=0
for i in range(n):
    if check[i]%2==0:
        if check[i]%3!=0 and check[i]%5!=0:
            f=1
                
if f==1:
    print("DENIED")
else:
    print("APPROVED")
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
import math

N = INT()
A = LIST()


if (N == 0 and A[0] != 1) or (N > 0 and A[0] != 0):
    print(-1)
    exit()


node_min, node_max = [0]*(N+1), [0]*(N+1)
node_min[-1] = A[-1]
node_max[-1] = A[-1]
for i in reversed(range(N)):
    node_min[i] = max(math.ceil(node_min[i+1]/2) + A[i]
    node_max[i] = node_max[i+1] + A[i]


if node_min[0] > 1:
    print(-1)
    exit()

ans = 1
node = 1
for i in range(1, N+1):
    node = min(node_max[i], 2*node)
    ans += node
    node = node - A[i]


print(ans)







### FIXED CODE ###

def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
import math

N = INT()
A = LIST()


if (N == 0 and A[0] != 1) or (N > 0 and A[0] != 0):
    print(-1)
    exit()


node_min, node_max = [0]*(N+1), [0]*(N+1)
node_min[-1] = A[-1]
node_max[-1] = A[-1]
for i in reversed(range(N)):
    node_min[i] = math.ceil(node_min[i+1]/2) + A[i]
    node_max[i] = node_max[i+1] + A[i]


if node_min[0] > 1:
    print(-1)
    exit()

ans = 1
node = 1
for i in range(1, N+1):
    node = min(node_max[i], 2*node)
    ans += node
    node = node - A[i]


print(ans)
N,K=map(int,input().split())
h=list(map(int,input().split()))
ans=[0]*N
ans[1]=abs(h[1]-h[0])
for i in range(2,N):
    cost=[]
    for j in range(max(0,i-K),i):
        cost.append(abs(h[i]-h[c])+ans[c])
    ans[i]=min(cost)
print(ans[-1])

### FIXED CODE ###

def main():
    N,K = map(int,input().split())
    h = list(map(int,input().split()))
    dp = [0]*N
    for i in range(1,N):
        dp[i]= min(abs(h[i]-h[j])+dp[j] for j in range(max(0,i-K),i))
    print(dp[-1])
main()
A,B,X = map(int, input().sp;it())
 
if (X>=A and X<=(A+B)):
    print("YES")
else:
    print("NO")

### FIXED CODE ###

A,B,X = (int(i) for i in input().split())
 
if (X>=A and X<=(A+B)):
    print("YES")
else:
    print("NO")
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from heapq import heapify, heappop, heappush

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
 
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

def dijkstra(E, start):
    N_d = len(E)
    dist = [INF] * N_d
    dist[start] = 0
    q = [(0, start)]
    while q:
        dist_v, v = heappop(q)
        if dist[v] != dist_v:
            continue
        for u, dist_vu in E[v]:
            dist_u = dist_v + dist_vu
            if dist_u < dist[u]:
                dist[u] = dist_u
                heappush(q, (dist_u, u))
    return dist


N, M = MAP()
L = [LIST() for i in range(M)]
graph = defaultdict(list)

for a, b in L:
    graph[a-1].append((b-1, 1))
    graph[b-1].append((a-1, 1))

ans = 0

for i in range(M):
    a, b = L[i]
    E = deepcopy(graph)
    E[a-1].remove((b-1, 1))
    E[b-1].remove((a-1, 1))
    if dijkstra(E, i).count(INF) >= 1:
        ans += 1

print(ans)



### FIXED CODE ###

import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
from heapq import heappop, heapify, heappush

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
 
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N, M = MAP()
L = [LIST() for i in range(M)]

graph = defaultdict(list)

def dijkstra(E, start):
    N_d = len(E)
    dist = [INF] * N_d
    dist[start] = 0
    q = [(0, start)]
    while q:
        dist_v, v = heappop(q)
        if dist[v] != dist_v:
            continue
        for u, dist_vu in E[v]:
            dist_u = dist_v + dist_vu
            if dist_u < dist[u]:
                dist[u] = dist_u
                heappush(q, (dist_u, u))
    return dist


for a, b in L:
    graph[a-1].append((b-1, 1))
    graph[b-1].append((a-1, 1))

ans = 0
for a, b in L:
    E = deepcopy(graph)
    E[a-1].remove((b-1, 1))
    d = dijkstra(E, a-1)
    if d[b-1] == INF:
        ans += 1
print(ans)
AB, BC, CA = map(int, input().split())

print(int(AB + BC + CA) / 2))

### FIXED CODE ###

import math

AB, BC, CA = map(int, input().split())
s = (AB + BC + CA) / 2

print(int(math.sqrt(s* (s - AB) * (s - BC) * (s - CA))))
n, q = [int(i) for i in input().aplit()]
s = input()
for _ in range(q):
    l, r = [int(i) for i in input().aplit()]
    print(
        len([i for i in [a + b for a, b in zip(s[l-1: r], s[l: r+1])] if i == 'AC']))

### FIXED CODE ###

import sys
from itertools import accumulate


def main():
    input = sys.stdin.readline
    n, q = [int(i) for i in input().split()]
    s = input().strip()
    qs = [[int(i) for i in input().split()] for _ in range(q)]
    hoges = [0] + [1 if s[i : i + 2] == "AC" else 0 for i in range(n - 1)]
    hoges = list(accumulate(hoges))
    for (l, r) in qs:
        print(hoges[r - 1] - hoges[l - 1])


if __name__ == "__main__":
    main()
k=N%2
if k==0:
    print(round(N/2.0))
else:
    print(round(N/2+1/2.0))

### FIXED CODE ###

n=input()
N=float(n)
k=N%2
if k==0:
    print(round(N/2.0))
else:
    print(round(N/2+1/2.0))
from collections import deque

k = int(input())
q = deque(range(1, 10))

for i in range(k-1):
    # popをk-1回やる
    x = q.popleft()
    y = int(str(x)[-1])
    if y-1 >= 0:
        print(int(str(x)+str(y-1)))
        q.append(int(str(x)+str(y-1)))
    q.append(int(str(x)+str(x)[-1]))
    if y+1 < 10:
        q.append(int(str(x)+str(y+1)))

print(q[0])




### FIXED CODE ###

a, b, c = list(map(int, input().split()))
print(c,a,b)
"""B - K-th Common Divisor"""
A,B,K=(int(i) for i in input().split())
result=[]
for i in range(1,min(A,B)):
    if A%i==0 and B%i==0:
        result.append(i)
print(result[K-1])

### FIXED CODE ###

"""B - K-th Common Divisor"""
A,B,K=(int(i) for i in input().split())
result=[]
for i in range(1,101):
    if A%i==0 and B%i==0:
        result.append(i)
result.reverse()
print(result[K-1])
l,r,d=map(int.input().split())
print(r//d-(l-1)//d)


### FIXED CODE ###

l, r, d = map(int, input().split())
print(r//d - (l-1)//d)
n = int(input())
s = input()
a = s.count("R")
b = s.count("G")
c = s.count("B")
z = a*b*c
if z ==0:
  print(0)
else:
  R=[]
  G=[]
  B=[]
  for i in range(n):
    if s[i]=="R":
      R.append(i)
    elif s[i]=="G":
      G.append(i)
    else:
      B.append(i)
  x = 0
  for i in R:
    for j in G:
      if (0<= 2*j-i <=n-1 and s[2*j-i] in B) or (0<= 2*i-j <=n-1 and s[2*i-j] in B):
          x += 1
print(z-x)

### FIXED CODE ###

n = int(input())
s = input()
a = s.count("R")
b = s.count("G")
c = s.count("B")
z = a*b*c
R=[]
G=[]
B=[]
for i in range(n):
  if s[i]=="R":
    R.append(i)
  elif s[i]=="G":
    G.append(i)
  else:
    B.append(i)
x = 0
for i in R:
  for j in G:
    if 0 <= 2*j-i <= n-1 and s[2*j-i]=="B":
      x+=1
    if 0 <= 2*i-j <= n-1 and s[2*i-j]=="B":
      x+=1
    if (i+j)%2==0 and s[(i+j)//2]=="B":
      x+=1
print(z-x)
N, M = map(int, input().split())
check = [[] for i in range(M+1)]
P, Y = [0]*M, [0]*M

for i in range(M):
    P[i], Y[i] = map(int, input().split())
    check[P[i]].append(Y[i]) 

for i in range(1, M+1):
    check[i].sort()

for i in range(0, M):
    check[P[i]].sort()
    num = check[P[i]].index(Y[i])+1
    mae = ((6-len(str(num)))*'0')+str(P[i])
    ato = ((6-len(str(P[i])))*'0')+str(num)
    print(mae+ato)

### FIXED CODE ###

N, M = map(int, input().split())
cnt = [0 for i in range(N + 1)] 
check = []
ans = []

for i in range(M):
    p, y = map(int, input().split())
    check.append((y, p, i))

check.sort()

for y, p, i in check:
    cnt[p] += 1
    ans.append((i,str(p).zfill(6)+str(cnt[p]).zfill(6)))

ans.sort()

for aa, bb in ans:
    print(bb)
"""難しいすぎるよぅ..."""

def solve():
    R, C = list(map(int, input().split()))
    N = int(input())
    row = [[] for _ in range(R)]
    field = {}
    for _ in range(N):
        r, c, a = list(map(int, input().split()))
        r, c = r - 1, c - 1
        row[r].append((c, a))
        field[(r, c)] = a
    row = [sorted(r) for r in row]
    for rn, r in enumerate(row):
        for i, e1 in enumerate(r):
            for e2 in r[i+1:]:
                n = e2[0] - e1[0]
                print(r, e1, e2, n)
                if n > C:
                    break
                a = field.get((rn+n, e1[0]), None)
                b = field.get((rn+n, e2[0]), None)
                if a is None and b is None:
                    continue
                if a is None:
                    if e1[1] + b - e2[1] < 0:
                        return False
                elif b is None:
                    if e2[1] + a - e1[1] < 0:
                        return False
                else:
                    if e1[1] + b == e2[1] + a:
                        return False
    return True

print("Yes" if solve() else "No")


### FIXED CODE ###

s = input()
print(s[:4]+" "+s[4:])
N = int(input())
H = [int(s) for s in input().split(" ")]

ans = 0
st = 0
for i in range(1, N):
  if H[i] - H[i - 1] > 0:
    ans = max(i - st - 1, ans)
    st = i

ans = max(ans, i - st)
print(ans)


### FIXED CODE ###

N = int(input())
H = list(map(int, input().split(" ")))
H.reverse()
H.append(float('inf'))	# sentinel value
ans = 0
ind, counter = 0, 0

while ind < N:
  if H[ind] <= H[ind + 1]:
    counter += 1
    ind += 1
  else:
    ans = max(ans, counter)
    counter = 0
    ind += 1
print(max(ans, counter - 1))
s = list(str(input()))
x,y = map(int,input().split())

i = 0
while i < len(s) and s[i] =="F":
    i += 1
x -= i
s = s[i:]

m = [[],[]]
num = 0

for i in range(len(s)):
    if s[i] == "F":
        m[num][-1] += 1
    else:
        num += 1
        num %= 2
        m[num].append(0)

#print("m",m)

sumx = sum(m[0])
dpx = [False]*(2*sumx+3) #index(sumx+1)が座標0
dpx[sumx+1] = True
#print("dpx",dpx)

for p in m[0]:
    dpx_pre = dpx[:]
    dpx = [False]*(2*sumx+3)
    for i in range(2*sumx+3):
        if i-p >= 0:
            dpx[i-p] = dpx_pre[i] or dpx[i-p]
            #print("dpx",dpx)
        if i+p < 2*sumx+3:
            dpx[i+p] = dpx_pre[i] or dpx[i+p]
            #print("dpx",dpx)
    #print("dpx",dpx)

sumy = sum(m[1])
dpy = [False]*(2*sumy+3) #index(sumy+1)が座標0
dpy[sumy+1] = True
#print("dpy",dpy)

for p in m[1]:
    dpy_pre = dpy[:]
    dpy = [False]*(2*sumy+3)
    for i in range(2*sumy+3):
        if i-p >= 0:
            dpy[i-p] = dpy_pre[i] or dpy[i-p]
        if i+p < 2*sumy+3:
            dpy[i+p] = dpy_pre[i] or dpy[i+p]
    #print("dpy",dpy)

if dpx[x+(sumx+1)] and dpy[y+(sumy+1)]:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

s = list(str(input()))
x,y = map(int,input().split())

i = 0
while i < len(s) and s[i] =="F":
    i += 1
x -= i
s = s[i:]

m = [[],[]]
num = 0

for i in range(len(s)):
    if s[i] == "F":
        m[num][-1] += 1
    else:
        num += 1
        num %= 2
        m[num].append(0)

#print("m",m)

sumx = sum(m[0])

dpx = [False]*(2*sumx+3) #index(sumx+1)が座標0
dpx[sumx+1] = True
#print("dpx",dpx)

for p in m[0]:
    dpx_pre = dpx[:]
    dpx = [False]*(2*sumx+3)
    for i in range(2*sumx+3):
        if i-p >= 0:
            dpx[i-p] = dpx_pre[i] or dpx[i-p]
            #print("dpx",dpx)
        if i+p < 2*sumx+3:
            dpx[i+p] = dpx_pre[i] or dpx[i+p]
            #print("dpx",dpx)
    #print("dpx",dpx)

sumy = sum(m[1])
dpy = [False]*(2*sumy+3) #index(sumy+1)が座標0
dpy[sumy+1] = True
#print("dpy",dpy)

for p in m[1]:
    dpy_pre = dpy[:]
    dpy = [False]*(2*sumy+3)
    for i in range(2*sumy+3):
        if i-p >= 0:
            dpy[i-p] = dpy_pre[i] or dpy[i-p]
        if i+p < 2*sumy+3:
            dpy[i+p] = dpy_pre[i] or dpy[i+p]
    #print("dpy",dpy)

if abs(x) > sumx+1 or abs(y) > sumy+1:
    print("No")
elif dpx[x+(sumx+1)] and dpy[y+(sumy+1)]:
    print("Yes")
else:
    print("No")
while True:
    try:
        x = int(raw_input())
        
        
        count = 0
        for a in range(10):
            for b in range(10):
                for c in range(10):
                    for d in range(10):
                        if a+b+c+d == x :
                            count += 1
        
        print count

    except ValueError:
        break

### FIXED CODE ###



while True:
    try:
        x = input()
        
        
        count = 0
        for a in range(10):
            for b in range(10):
                for c in range(10):
                    for d in range(10):
                        if a+b+c+d == x :
                            count += 1
        
        print count

    except EOFError:
        break
N=int(input())
AB = [list(map(int, input().split())) for _ in range(N-1)] #N-1
C = list(map(int, input().split())) #N
C.sort()

M = sum(C[:-1])

adjacent_dict={}
for a,b in AB:
  adjacent_dict.setdefault(a, set()).add(b)
  adjacent_dict.setdefault(b, set()).add(a)
  

leafs = []
adjacents = [0] * (N+1) # a[i]: 頂点i
for k, v in adjacent_dict.items():
  adjacents[k] = len(v)
  if len(v)==1:
    leafs.append(k)

nodes = leafs.copy() #小さい値を入れたい順のノード
visited = [0] * (N+1) # visited[i]: 頂点i
for n in nodes:
  visited[n] = 1
  
stack = leafs.copy()
while stack:
  new_stack=[]
  for v in stack:
    for u in adjacent_dict[v]:
      adjacents[u] -= 1
      if visited[u]==0:
        visited[u]=1
        nodes.append(u)
        new_stack.append(u)
  stack = [v for v in new_stack if adjacents[v]==0]
  
ans = [0]*(N)
for i in range(N):
  ans[nodes[i]-1] = C[i]
  
print(M)
print(*ans)


### FIXED CODE ###

N=int(input())
AB = [list(map(int, input().split())) for _ in range(N-1)] #N-1
C = list(map(int, input().split())) #N
C.sort()

M = sum(C[:-1])

adjacent_dict={}
for a,b in AB:
  adjacent_dict.setdefault(a, set()).add(b)
  adjacent_dict.setdefault(b, set()).add(a)
  

leafs = []
adjacents = [0] * (N+1) # a[i]: 頂点i
for k, v in adjacent_dict.items():
  adjacents[k] = len(v)
  if len(v)==1:
    leafs.append(k)

nodes = leafs.copy() #小さい値を入れたい順のノード
visited = [0] * (N+1) # visited[i]: 頂点i
for n in nodes:
  visited[n] = 1
  
#while leafs:
#  next_leafs = set()
#  for l in leafs:
#    for u in adjacent_dict[l]:
#      acjacents[u] -= 1
#      next_leafs.add(u)
  
  
while leafs:
  new_stack = []
  for v in leafs:
    for u in adjacent_dict[v]:
      adjacents[u] -= 1
      if visited[u]==0:
        visited[u]=1
        new_stack.append(u)
  leafs = [v for v in new_stack if adjacents[v]==1]
  nodes.extend(leafs)
  if not leafs:
    nodes.extend(new_stack) #最後に隣接0のノードが残ったとき
    break
  for u in [v for v in new_stack if adjacents[v]!=1]:
    visited[u] = 0
    
  
ans = [0]*(N)
for i in range(N):
  ans[nodes[i]-1] = C[i]
  
print(M)
print(*ans)
N,K = list(map(int,input().split()))
edges = [[] for _ in range(N+1)]

import operator as op
from functools import reduce

MOD = 1000000007

for _ in range(N-1):
    (e1, e2) = tuple(map(int, input().split()))
    edges[e1].append(e2)
    edges[e2].append(e1)

children = [[] for _ in range(N+1)]
seen = set()
stack = []

stack.append(1)
seen.add(1)

while stack:
    node = stack[-1]
    stack.pop()
    for edge in edges[node]:
        if edge not in seen:
            seen.add(edge)
            children[node].append(edge)
            stack.append(edge)

def solve(node, siblings, depth):
    num_children = len(children[node])

    has_grandparent = depth >= 2
    has_parent = depth >= 1

    ans = max(0, K-(siblings)-int(has_parent)-int(has_grandparent))
    child_siblings = 0
    for child in children[node]:
        ans *=  solve(child, child_siblings, depth+1)
        ans %= MOD
        child_siblings += 1
    return ans


print(solve(1, 0, 0) % MOD)



### FIXED CODE ###

import sys
sys.setrecursionlimit(1000000)

N,K = list(map(int,input().split()))
edges = [[] for _ in range(N+1)]

MOD = 1000000007

for _ in range(N-1):
    (e1, e2) = tuple(map(int, input().split()))
    edges[e1].append(e2)
    edges[e2].append(e1)

children = [[] for _ in range(N+1)]
seen = set()
stack = []

stack.append(1)
seen.add(1)

while stack:
    node = stack[-1]
    stack.pop()
    for edge in edges[node]:
        if edge not in seen:
            seen.add(edge)
            children[node].append(edge)
            stack.append(edge)

def solve(node, siblings, depth):
    num_children = len(children[node])

    has_grandparent = depth >= 2
    has_parent = depth >= 1

    ans = max(0, K-(siblings)-int(has_parent)-int(has_grandparent))
    child_siblings = 0
    for child in children[node]:
        ans *=  solve(child, child_siblings, depth+1)
        ans %= MOD
        child_siblings += 1
    return ans


print(solve(1, 0, 0) % MOD)
K = int(input())
X = int(input())
k = K * 500
if k > X:
  print('Yes')
else:
  print('No')
  

### FIXED CODE ###

K, X = map(int, input().split())
k = K * 500
if k >= X:
  print('Yes')
else:
  print('No')
n,*a=map(int,open(0).read().split())
d=[j-i for i,j in zip(a,a[1:]+[a[0]])]
M=max(d)
dd=[M-x for x in d]
if all(x%n==0 for x in dd) and sum(x//n for x in dd)==M and sum(a)//M==n*(n+1)//2:
	print("YES")
else:
	print("NO")

### FIXED CODE ###

n,*a=map(int,open(0).read().split())
d=[j-i for i,j in zip(a,a[1:]+[a[0]])]
M=max(d)
dd=[M-x for x in d]
if n==1:
	print("YES")
elif (n==2 and sum(a)%3) or any(x%n for x in dd) or sum(x//n for x in dd)!=M or sum(a)//M!=n*(n+1)//2:
	print("NO")
else:
	print("YES")
import math

A, B, K = map(int, input().split())

gcd = math.gcd(A, B)
order = 0
for i in range(gcd, 0, -1):
    if gcd % i == 0:
        order += 1
        if order == K:
            print(i)
            break


### FIXED CODE ###

import fractions

A, B, K = map(int, input().split())

gcd = fractions.gcd(A, B)
order = 0
for i in range(gcd, 0, -1):
    if gcd % i == 0:
        order += 1
        if order == K:
            print(i)
            break
import math
#import fractions as math
n = int(input())
list1 = list(map(int,input().split()))
if math.gcd(list1[0],list1[1]) < math.gcd(list1[0],list1[-1]):
	a = math.gcd(list1[0],list1[-1])
	b = 0
else:
	a = math.gcd(list1[0],list1[1])
	b = -1

for i in range(0,n):
	if a > math.gcd(a,list1[i]):
		a = math.gcd(a,list1[i])
		b = list1.index(list1[i])
del list1[b]
a = list1[0]
for i in range(0,len(list1)):
	a = min(a,math.gcd(a,list1[i]))
print(a)

### FIXED CODE ###

from collections import deque
import fractions as math
n = int(input())
list1 = list(map(int,input().split()))
list1 = deque(list1)
L = deque([0])
R = deque([0])
M = []

for i in range(len(list1)-1):
	L.append(math.gcd(L[i],list1[i]))
	R.append(math.gcd(R[i],list1[n-i-1]))

for i in range(len(L)):
	M.append(math.gcd(L[i],R[len(R)-i-1]))
print(max(M))
def solve(H, W, S):
    for h in range(1, H):
        for w in range(1, W):
            if S[h][w] == '#':
                if not (S[h-1][w] == '#' or S[h+1][w] == '#' or S[h][w+1] == '#' or S[h][w-1] == '#'):
                    return "No"
    return "Yes"


H, W = [int(x) for x in input().split()]
# H, W < 50
S = []
S.append('.' * (H+2))
for _ in range(H):
    S.append("."+input().strip()+".")
S.append('.' * (H+2))
print(solve(H, W, S))



### FIXED CODE ###

def solve(H, W, S):
    for h in range(1, H):
        for w in range(1, W):
            if S[h][w] == '#':
                if not (S[h-1][w] == '#' or S[h+1][w] == '#' or S[h][w+1] == '#' or S[h][w-1] == '#'):
                    return "No"
    return "Yes"


H, W = [int(x) for x in input().split()]
# H, W < 50
S = []
S.append('.' * (W+2))
for _ in range(H):
    S.append("."+input().strip()+".")
S.append('.' * (W+2))
import sys
for row in S:
    print(row, file=sys.stderr)
print(solve(H, W, S))