Harryxun/sft_time huggingface dataset:
### BUGGY CODE ###

from collections import defaultdict, deque

class UnionFind:
  def __init__(self, n):
    self.par = [i for i in range(n)]
    self.size = [1]*n
    self.rank = [0]*n
    self.P = [1]*n
  def find(self, x):
    if self.par[x]==x:
      return x
    else:
      self.par[x] = self.find(self.par[x])
      return self.par[x]
  def unit(self, x, y):
    x = self.find(x)
    y = self.find(y)
    if x==y:
      return
    elif self.rank[x]<self.rank[y]:
      self.par[x] = y
      self.P[x] = 0
      self.size[y] += self.size[x]
      return
    elif self.rank[y]<self.rank[x]:
      self.par[y] = x
      self.P[y] = 0
      self.size[x] += self.size[y]
    else:
      self.par[y] = x
      self.P[y] = 0
      self.size[x] += self.size[y]
      self.rank[x] += 1
      
  def same(self, x, y):
    return self.find(x)==self.find(y)
  
  def count(self, x):
    return self.size[x]

N, M = map(int, input().split())
dic = defaultdict(list)
union = UnionFind(N)

for i in range(M):
  l, r, d = map(int, input().split())
  dic[l-1] += [(r-1,d)]
  dic[r-1] += [(l-1,-d)]
  union.unit(l-1, r-1)

pair = []
for x in range(N):
  if union.P[x]==1:
    pair += [x]

dist = [-1]*N
for c in pair:
  stuck = deque([(c,0)])
  dist[c] = 0
  while stuck:
    e, a = stuck.popleft()
    flag = False
    for c in dic[e]:
      p, d = c
      x = d + dist[e]
      if dist[p]==-1:
        dist[p] = x
        stuck += [(p, x)]
      elif dist[p]!=x:
        print('No')
        flag = True
        break
    if flag:
      break
  if flag:
    break
else:
  print('Yes')

### FIXED CODE ###

from collections import defaultdict, deque
N, M = map(int, input().split())
used = [True]*N
dic = defaultdict(list)
for i in range(M):
  l, r, d = map(int,input().split())
  l -= 1
  r -= 1
  used[r] = False
  dic[l] += [(r,d)]

dist = [-1]*N
q = deque([])
for i in range(N):
  if used[i]:
    q += [i]
    dist[i] = 0

ans = True
while q:
  e = q.popleft()
  flag = False
  for p, d in dic[e]:
    if dist[p]==-1:
      dist[p] = d+dist[e]
      q += [p]
    elif dist[p]!=dist[e]+d:
      ans = False
      flag = True
      break
  if flag:
    break
if ans:
  if -1 not in dist:
    print('Yes')
  else:
    print('No')
else:
  print('No')
### BUGGY CODE ###

import itertools
R,G,B,n = map(int, input().split())
ans = 0
for r in range(n//R+1):
    if R*r > n: break
    for g in range(n//G+1):
        ball = R*r + G*g
        if ball > n or (n-ball)%B!=0: continue
        ans += 1
print(ans)

### FIXED CODE ###

R, G, B, N = map(int, input().split())
ans = 0

a = max(R, G, B)
if a == R:
  b = max(G, B)
elif a == G:
  b = max(B, R)
else:
  b = max(R, G)
c = min(R, G, B)
for i in range(N//a+1):
  for j in range((N-a*i)//b+1):
    if ((N-a*i)-b*j)%c == 0:
      ans += 1
print(ans)
### BUGGY CODE ###

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

MOD = 10 ** 9 + 7

N = int(input())
A = list(map(int, input().split()))
B = [bin(a) for a in A]

maxA = max(A)
mask = 1

count = 0
i = 0
while maxA >> i:
    zeros = sum([1 for a in A if (mask * 2**i) & a == 0]) % MOD
    ones = (len(A) - zeros) % MOD
    count += zeros * ones * ((2**i) % MOD)
    count %= MOD
    i += 1

print(count)

### FIXED CODE ###

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

MOD = 10 ** 9 + 7

N = int(input())
A = list(map(int, input().split()))
B = [bin(a) for a in A]

maxA = max(A)
mask = 1

count = 0
i = 0
while maxA >> i:
    zeros = sum([1 for a in A if (mask * 2**i) & a == 0]) % MOD
    ones = (len(A) - zeros) % MOD
    count += zeros * ones * ((2**i) % MOD)
    count %= MOD
    i += 1

print(count)
### BUGGY CODE ###

n = int(raw_input().rstrip())
a = map(int, raw_input().split())
b = []
for i in range(n):
    b.append(a[i])
    b.reverse()
ans = map(str, b)
print ' '.join(ans)


### FIXED CODE ###

n = int(raw_input().rstrip())
a = map(int, raw_input().split())
a_odd = a[0::2]
a_even = a[1::2]
a_even.reverse()
a_even.extend(a_odd)
b = map(str, a_even)
if len(b) % 2 !=0:
    b.reverse()
print ' '.join(b)
### BUGGY CODE ###

n = int(input())
s = []
for _ in range(n):
    sw = input()
    s.append([c for c in sw])

def allequal(s):
    for i in range(n):
        for j in range(n):
            if s[i][j] != s[0][0]:
                return False
    return True

def val(s,k):
    global n
    for i in range(n):
        for j in range(n):
            if i+k >= n:
                ni = i+k-n
            else:
                ni = i+k
            if j-k < 0:
                nj = j-k+n
            else:
                nj = j-k
            if s[i][j] != s[nj][ni]:
                return False
    return True

if allequal(s):
    print(n**2)
else:
    res = 0
    for k in range(0,n):
        if val(s,k):
            res += n
    print(res)

### FIXED CODE ###

n = int(input())
s = []
for _ in range(n):
    s.append(input())
st=list(map(''.join,zip(*s)))

def plusa(s,a):
    ns = []
    for ss in s:
        ns.append(ss[a:]+ss[:a])
    return ns

def plusb(s,b):
    global n
    ns = []
    for i in range(n-b):
        ns.append(s[b+i])
    for i in range(b):
        ns.append(s[i])
    return ns

res = 0
for i in range(n):
    if plusa(st,i) == plusb(s,i):
        res += n

print(res)
### BUGGY CODE ###

n, k = (int(x) for x in input().split())
a = input().split()

point = []

for j in range(n-k+1):
    temp = int(a[j])
    for i in range(j+1,k+j):
        temp = temp * (int(a[i]))
    point.append(temp)

for i in range(1,n-k+1):

    if(point[i-1] >= point[i]):
        print("No")
    else:
        print("Yes")


### FIXED CODE ###


n, k = (int(x) for x in input().split())
a = input().split()

for i in range(1,n-k+1):
    if(int(a[i-1]) >= int(a[k+i-1])):
        print("No")
    else:
        print("Yes")
### BUGGY CODE ###


n = int(input())
B = ['3', '5', '7']
count=0
ans=0
for i in range(357, min(n+1, 777777753), 2):
    A = list(str(i))
    C = list(set(A))
    C.sort()
    if(C==B):
        count+=1
print(count)


### FIXED CODE ###

import itertools
a = int(input())

A = ['0', '3', '5', '7']
B = []
count=0
for i, j, k, l, m, n, o, p, q, r in itertools.product(A, A, A, A, A, A, A, A, A, A):
    ans= i + j + k + l + m + n + o + p + q + r
    ans = int(ans)
    if(ans <=a):
        ans = list(str(ans))
        if('0' not in ans and '3' in ans and '5' in ans and '7' in ans):
            count+=1
    else:
        break
print(count)
### BUGGY CODE ###

n = int(input())
factor = []
tmp = n
for i in range(2, int(-(-n ** 0.5 // 1)) + 1):
    while tmp % i == 0:
        factor.append(i)
        tmp //= i
if tmp != 1:
    factor.append(tmp)
w = len(factor)
if w == 0:
    factor.append(n)
    w = 1
if w == 1:
    print(n - 1)
else:
    ans = 1000000000000
    for i in range(1, 2 ** w // 2):
        f2 = [1, 1]
        for j in range(w):
            f2[i & (2 ** j) == 0] *= factor[j]
        ans = min(ans, sum(f2) - 2)
    print(ans)


### FIXED CODE ###

n = int(input())
ans = 1000000000000
for i in range(1, int(n ** 0.5) + 1):
    if n % i == 0:
        a = i
        b = n // i
        ans = min(ans, a + b - 2)
print(ans)
### BUGGY CODE ###

import fractions
from functools import reduce

def gcd(numbers):
    return reduce(fractions.gcd, numbers)

N = input()
A = list(map(int, input().split()))

gcd_max = 0

for i, _ in enumerate(A):
    gcd_max = max(gcd_max, gcd(A[:i] + A[i+1:]))
    
print(gcd_max)

# 考え中。。。

### FIXED CODE ###

from fractions import gcd
 
N = int(input())
A = list(map(int, input().split()))
 
L = [0] * (N+1)
R = [0] * (N+1)
 
L[0] = 0
R[-1] = 0
 
for i in range(len(A)):
    L[i] = gcd(L[i-1], A[i])
    
for i in reversed(range(len(A))):
    R[i] = gcd(R[i+1], A[i])
    
ans = 0    
 
for i in range(N):
    ans = max(ans, gcd(L[i-1], R[i+1]))
    
print(ans)
### BUGGY CODE ###

n = int(input())
a = [int(input()) for _ in range(n)]
button = [0]*n
button1 = a[0] - 1
count = 1
try:
    _ = a.index(2)
except:
    print('-1')
    exit()
while True:
    button[button1] += 1
    button1 = a[button1] - 1
    if button[1] == 1:
        print(count)
        break
    try:
        button.remove(2)
        print('-1')
        break
    except:
        count += 1
        pass

### FIXED CODE ###

n = int(input())
a = [int(input()) for _ in range(n)]
now = a[0]
c = 1

if now == 2:
    print(1)
    exit()

for i in range(n):
    now = a[now-1]
    c += 1
    if now == 2:
        print(c)
        exit()
print(-1)
### BUGGY CODE ###

N = int(input())

NumArr = [int(num) for num in input().split()]

ans = 'YES'
for num in NumArr:
    matchCount = NumArr.count(num)
    if matchCount > 1:
        ans = 'NO'
        break

print(ans)


### FIXED CODE ###

N = int(input())

NumArr = [int(num) for num in input().split()]

flg = len(NumArr) == len(set(NumArr))

if flg:
    print('YES')
else:
    print('NO')
### BUGGY CODE ###

#!/usr/bin/env python
# -*- coding: utf-8 -*-

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


def checkAllLess(tgt):
    for id in range(tgt):
        # print("id=" + str(id) + ", pn[]=" + str(pn[id]) + ", tgt=" + str(tgt))
        if(pn[id] < pn[tgt]):
            # print('False')
            return False
    # print('True')
    return True


cnt = 1
min = pn[0]
for i in range(n):
    if (min > pn[i] and checkAllLess(i)):
        cnt += 1
    if (min > pn[i]):
        min = pn[i]
    # print(str(i) + ":" + str(cnt))

print(cnt)


### FIXED CODE ###

#!/usr/bin/env python
# -*- coding: utf-8 -*-

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

cnt = 1
min = pn[0]
for i in range(1, n):
    if min > pn[i]:
        cnt += 1
        min = pn[i]

print(cnt)
### BUGGY CODE ###

from collections import*
INF=10**18
h,w=map(int,input().split())
sh,sw=map(int,input().split())
gh,gw=map(int,input().split())
s=[input() for _ in range(h)]
q=deque([(sh-1,sw-1)])
d=[[INF]*w for _ in range(h)]
d[sh-1][sw-1]=0
dx=[1,0,-1,0]
dy=[0,-1,0,1]
wx=[-2,-1,0,1,2]
wy=[-2,-1,0,1,2]
while q:
  x,y=q.popleft()
  if (x,y)==(gh-1,gw-1):
    print(d[gh-1][gw-1])
    break
  for i in range(4):
    nx=x+dx[i]
    ny=y+dy[i]
    if not(0<=nx<h and 0<=ny<w):continue
    if s[nx][ny]=='.' and d[nx][ny]>d[x][y]:
      d[nx][ny]=d[x][y]
      q.append((nx,ny))
  for i in range(5):
    for j in range(5):
      nx=x+wx[i]
      ny=y+wy[j]
      if not(0<=nx<h and 0<=ny<w):continue
      if s[nx][ny]=='.' and d[nx][ny]>d[x][y]:
        d[nx][ny]=d[x][y]+1
        q.append((nx,ny))
else:print(-1)

### FIXED CODE ###

from collections import*
INF=10**18
h,w=map(int,input().split())
sh,sw=map(int,input().split())
gh,gw=map(int,input().split())
s=[input() for _ in range(h)]
q=deque([(sh-1,sw-1,0)])
d=[[INF]*w for _ in range(h)]
dx=[1,0,-1,0]
dy=[0,-1,0,1]
wx=[-2,-1,0,1,2]
wy=[-2,-1,0,1,2]
while q:
  x,y,c=q.popleft()
  if d[x][y]!=INF:continue
  d[x][y]=c
  for i,j in zip(dx,dy):
    nx=x+i
    ny=y+j
    if not(0<=nx<h and 0<=ny<w):continue
    if s[nx][ny]=='.' and d[nx][ny]==INF:
      q.appendleft((nx,ny,c))
  for i in wx:
    nx=x+i
    if not(0<=nx<h):continue
    for j in wy:
      ny=y+j
      if not(0<=ny<w):continue
      if s[nx][ny]=='.' and d[nx][ny]==INF:
        q.append((nx,ny,c+1))
print(d[gh-1][gw-1]if d[gh-1][gw-1]!=INF else -1)
### BUGGY CODE ###

import sys
input=sys.stdin.readline
n=int(input())
s=[ord(i)for i in input()]
t=[-1]*n
for i in range(n):
  if s[i]==68:
    t[i]=0
  elif s[i]==77:t[i]=1
  elif s[i]==67:t[i]=2

def solve(k):
  d_p=[0]*2*n
  d_m=[0]*2*n
  m_p=[0]*2*n
  m_m=[0]*2*n
  dd=mm=dm=dmc=0
  for i in range(n):
    if t[i]==0:dd+=1
    if i>=k and t[i-k]==0:dm-=mm;dd-=1
    if t[i]==1:dm+=dd;mm+=1
    if i>=k and t[i-k]==1:mm-=1
    if t[i]==2:dmc+=dm
  return dmc

q=int(input())
k=list(map(int,input().split()))
for i in k:print(solve(i))

### FIXED CODE ###

import sys
input=sys.stdin.readline

n=int(input())
s=[ord(i)for i in input()]
t=[-1]*n
for i in range(n):
  if s[i]==68:
    t[i]=0
  elif s[i]==77:t[i]=1
  elif s[i]==67:t[i]=2

def solve(k):
  dd=mm=dm=dmc=0
  for i in range(n):
    if t[i]==0:dd+=1
    if i>=k and t[i-k]==0:dm-=mm;dd-=1
    if t[i]==1:dm+=dd;mm+=1
    if i>=k and t[i-k]==1:mm-=1
    if t[i]==2:dmc+=dm
  return dmc

q=int(input())
k=list(map(int,input().split()))
for i in k:print(solve(i))
### BUGGY CODE ###

def pre_cmb_mod(n, mod):
    if n == 0:
        return [1], [1]
    fact = [1, 1]
    inv = [0, 1]
    factinv = [1, 1]
    for i in range(2, n+1):
        fact.append((fact[-1] * i) % mod)
        inv.append((-inv[mod % i] * (mod//i)) % mod)
        factinv.append((factinv[-1] * inv[-1]) % mod)
    return fact, factinv


def cmb_mod(n, r, mod, fact, factinv):
    if (r < 0) or (n < r):
        return 0
    r = min(r, n - r)
    return fact[n] * factinv[r] * factinv[n - r] % mod


mod = 10**9 + 7
n, a, b = map(int, input().split())

fact, factinv = pre_cmb_mod(n, mod)

result = 0
for r in range(1, n+1):
    if r == a or r == b:
        continue
    result += cmb_mod(n, r, mod, fact, factinv)
    result %= mod

print(result)

### FIXED CODE ###

def comb_mod(n, k, p):
    """
    nCk mod p
    """
    numerator = 1
    denominator = 1
    for i in range(k):
        numerator *= n - i
        numerator %= p
        denominator *= i + 1
        denominator %= p
    return numerator * pow(denominator, p-2, p) % p

mod = 10**9 + 7
n, a, b = map(int, input().split())
result = pow(2, n, mod) - 1

for i in (a, b):
    result -= comb_mod(n, i, mod)
result %= mod

print(result)
### BUGGY CODE ###

import copy
h,w = map(int,input().split())

#aij = [input() for i in range(h)]

moji = [[0 for i in range(w)] for j in range(h)]

for i in range(h):
    aij = input()
    #print(aij)
    for j in range(w):
        moji[i][j] = aij[j]

#moji = aij
#print(moji,aij)
#exit()

#print(aij)
vx = [0,1,0,-1]
vy = [1,0,-1,0]

ans = 0
flag = False

while flag == False:
    #print(moji)
    moji_old = copy.deepcopy(moji)
    for i in range(h*w):
        y = i//w
        x = i%w
        if moji_old[y][x] == '.':
            flag = False
            break
        else:
            flag = True
    
    for i in range(h*w):
        y = i//w
        x = i%w
        #print(i)
        if moji_old[y][x] == '#':
            for j in range(4):
                nx = x+vx[j]
                ny = y+vy[j]
                #print(ny,nx)
                if nx < 0 or nx >= w or ny < 0 or ny >= h:
                    continue
                if moji[ny][nx] == "#":
                    continue
                moji[ny][nx] = '#'
    
    if flag == True:
        break
                
    ans += 1
    
print(ans)

### FIXED CODE ###

import queue
from collections import deque
h,w = map(int,input().split())

#aij = [input() for i in range(h)]

moji = [[0 for i in range(w)] for j in range(h)]

dist = [[-1]*w for _ in range(h)]

for i in range(h):
    aij = input()
    #print(aij)
    for j in range(w):
        moji[i][j] = aij[j]

#moji = aij
#print(moji,aij)
#exit()

#print(aij)
vx = [0,1,0,-1]
vy = [1,0,-1,0]

ans = 0
q = deque()

for i in range(h*w):
    y = i//w
    x = i%w
    #print(i)
    if moji[y][x] == '#':
        q.append(i)
        dist[y][x] = 0

#ans = -1

ans = 0

while q:
    #print(q.qsize())
    tmp = q.popleft()
    y = tmp//w
    x = tmp%w
    d = dist[y][x]
    #print(tmp,num)
    for j in range(4):
        nx = x+vx[j]
        ny = y+vy[j]
        #print(ny,nx)
        if nx < 0 or nx >= w or ny < 0 or ny >= h:
            continue
        if dist[ny][nx] == -1:
            dist[ny][nx] = d+1
            #moji[ny][nx] = '#'
            q.append(ny*w+nx)
    #ans += 1
    ans = max(d,ans)

print(ans)
### BUGGY CODE ###

S = input()
Q = int(input())
rev = False
for _ in range(Q):
    Query = input().split()
    if Query[0] == '1':
        rev = not rev
    else:
        if rev:
            if Query[1] == '1':
                S = S + Query[2]
            else:
                S = Query[2] + S
        else:
            if Query[1] == '1':
                S = Query[2] + S
            else:
                S = S + Query[2]
if rev:
    S = S[::-1]
print(S)


### FIXED CODE ###

S = input()
Q = int(input())
L = ''
R = ''
rev = False
for _ in range(Q):
    Query = input().split()
    if Query[0] == '1':
        rev = not rev
    else:
        if rev:
            if Query[1] == '1':
                R = R + Query[2]
            else:
                L = Query[2] + L
        else:
            if Query[1] == '1':
                L = Query[2] + L
            else:
                R = R + Query[2]
S = L + S + R
if rev:
    S = S[::-1]
print(S)
### BUGGY CODE ###

s = list(input())
MOD = 10**9 + 7
cnt = [[] for _ in range(len(s))]
i = len(s) - 1
de = 1

while i >= 0:
    if s[i] == '?':
        for j in range(10):
            cnt[i].append((j * de) % 13)
    else: cnt[i].append((int(s[i]) * de) % 13)
    i -= 1
    de *= 10

dp = [[0]*13 for _ in range(len(s))]
for i in cnt[0]:
    dp[0][i] = 1
for i in range(1, len(s)):
    for j in cnt[i]:
        for k in range(13):
            if dp[i-1][k] != 0:
                dp[i][(j + k)%13] += dp[i - 1][k]
                dp[i][(j + k)%13] %= MOD
print(dp[-1][5])

### FIXED CODE ###

s = list(input())
MOD = 10**9 + 7
cnt = [[] for _ in range(len(s))]
i = len(s) - 1
de = 1

while i >= 0:
    if s[i] == '?':
        for j in range(10):
            cnt[i].append((j * de) % 13)
    else: cnt[i].append((int(s[i]) * de) % 13)
    i -= 1
    de *= 10
    de %= 13

dp = [[0]*13 for _ in range(len(s))]
for i in cnt[0]:
    dp[0][i] = 1
for i in range(1, len(s)):
    for j in cnt[i]:
        for k in range(13):
            if dp[i-1][k] != 0:
                dp[i][(j + k)%13] += dp[i - 1][k]
                dp[i][(j + k)%13] %= MOD
print(dp[-1][5])
### BUGGY CODE ###

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

counter = 0

while A != B or B != C or A != C:
    if A - B > 1 or A - C > 1 or B - A > 1 or B - C > 1 or C - A > 1 or C - B > 1:
        if A < B and A < C:
            A += 2
        elif B < A and B < C:
            B += 2
        else:
            C += 2
        counter += 1
    else:
        if A < C and B < C:
            A += 1
            B += 1
        elif A < B and C < B:
            A += 1
            C += 1
        else:
            B += 1
            C += 1
        counter += 1

print(counter)


### FIXED CODE ###

A,B,C = map(int,input().split())
 
counter = 0
 
while not A == B == C:
    A,B,C = sorted([A,B,C])
    if C - A > 1:
        A += 2
        counter += 1
    else:
        A += 1
        B += 1
        counter += 1
        
print(counter)
### BUGGY CODE ###

#!/usr/bin/env python3

import sys


def main():
    input = sys.stdin.readline
    N, K = map(int, input().split())

    n = 1
    while True:
        min_value = K ** (n - 1)
        max_value = K ** n - 1
        if min_value <= N < max_value:
            print(n)
            break
        n += 1


if __name__ == "__main__":
    main()


### FIXED CODE ###

#!/usr/bin/env python3

import sys
from math import floor, log


def main():
    input = sys.stdin.readline
    N, K = map(int, input().split())

    ans = floor(log(N) / log(K) + 1)
    print(ans)


if __name__ == "__main__":
    main()
### BUGGY CODE ###

N, K, *h = map( int, open( 0 ).read().split() )

d = [ 0 ] + [ 10**18 ] * ( N - 1 )
for i in range( N ):
  for k in range( 1, K + 1 ):
    if i - k >= 0: 
      d[ i ] = min( abs( h[ i ] - h[ i - k ] ) + d[ i - k ], d[ i ] )
print( d[-1] )

### FIXED CODE ###

N, K, *h = map( int, open( 0 ).read().split() )

d = [ 0 ] + [ 10**18 ] * ( N - 1 )
for i in range( N ):
  for k in range( 1, K + 1 ):
    if i - k >= 0: 
      d[ i ] = min( abs( h[ i ] - h[ i - k ] ) + d[ i - k ], d[ i ] )
print( d[-1] )
### BUGGY CODE ###

N, K, Q = map(int, input().split())
m = Q - K + 1
A = [input() for _ in range(Q)]
Ans = []
for i in range(N):
    if m <= 0:
        Ans.append("Yes")
    elif A.count(str(i+1)) < m:
        Ans.append("No")
    else:
        Ans.append("Yes")

for i in range(N):
    print(Ans[i])

### FIXED CODE ###

import collections

N, K, Q = map(int, input().split())
m = Q - K + 1
A = [input() for _ in range(Q)]
C = collections.Counter(A)
Ans = []
for i in range(N):
    if m <= 0:
        Ans.append("Yes")
    elif C[str(i+1)] < m:
        Ans.append("No")
    else:
        Ans.append("Yes")

for i in range(N):
    print(Ans[i])
### BUGGY CODE ###

def solve():
    N, K = map(int,input().split())
    A = list(map(int,input().split()))

    now = 1
    for i in range(K):
        now *= A[i]
    prev = now
    
    for i in range(K,N):
        now //= A[i-K]
        now *= A[i]
        if now > prev:
            print('Yes')
        else:
            print('No')
        prev = now

if __name__ == '__main__':
    solve()

### FIXED CODE ###

def solve():
    N, K = map(int,input().split())
    A = list(map(int,input().split()))
    
    for i in range(K,N):
        if A[i-K] < A[i]:
            print('Yes')
        else:
            print('No')

if __name__ == '__main__':
    solve()
### BUGGY CODE ###

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

if m%n==0:
    print(int(m/n))
else:
    for i in range(n+1,m+1):
        if m%i==0:
            print(int(m/i))
            break

### FIXED CODE ###

N,M = map(int, input().split())
L = []
 
for i in range(1,int(M**0.5)+1):
    if M % i == 0:
        L.append(i)
        L.append(int(M / i))
L1 = [i for i in L if M / i >= N]
print(max(L1))
### BUGGY CODE ###

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

n, m = map(int, input().split())
a = []
for _ in range(m):
    a.append(int(input()))

memo = {}


def step(now):
    if memo.get(now) != None:
        return memo[now]
    if now in a:
        return 0
    # print(now)
    if now == n:
        return 1
    if now > n:
        return 0
    # print(now)
    memo[now] = step(now+1)+step(now+2)
    return memo[now]


print(step(0) % 1000000007)

### FIXED CODE ###

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

n, m = map(int, input().split())
a = []
for _ in range(m):
    a.append(int(input()))
a=set(a)

memo = [0]*(n+1)
memo[0]=1
if not(1 in a):
    memo[1]=1

for i in range(2,n+1):
    #print(i)
    if i in a:
        continue
    #print(memo[i-1],memo[i-2])
    memo[i]=memo[i-2]+memo[i-1]
            

#print(memo)
print(memo[n]% 1000000007)
### BUGGY CODE ###

N = int(input())
HList = input().split()
mv = 0
for i in range(len(HList) - 1):
    tmv = 0
    for j in range(i, len(HList) - 1):
        if(j == N):
            break
        if(int(HList[j]) < int(HList[j + 1])):
            break
        tmv += 1
    if(mv < tmv):
        mv = tmv
print(mv)

### FIXED CODE ###

N = int(input())
HList = input().split()
res = 0
mv = 0
for i in range(len(HList) -1):
    if(int(HList[i]) >= int(HList[i + 1])):
        mv += 1
    else:
        if(res < mv):
            res = mv
        mv = 0
if(res < mv):
    res = mv
print(res)