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

from collections import deque

h, w = map(int, input().split())
S = [['#']*(w+2)]

for _ in range(h):
    s = str(input())
    new_s = ['#']
    for x in s:
        new_s.append(x)
    new_s.append('#')
    S.append(new_s)
S.append(['#']*(w+2))

Possible_list = []
for i in range(h+2):
    for j in range(w+2):
        if S[i][j] == '.':
            Possible_list.append((i,j))

max_length = 0

for zahyou in Possible_list:
    dq = deque()
    Visited = [-1 for _ in range(len(Possible_list))]
    Visited[Possible_list.index(zahyou)] = 0
    dq.append(zahyou)
    
    while dq:
        now = dq.popleft()
        
        Adj_possible = []
        if (now[0]-1, now[1]) in Possible_list:
            Adj_possible.append((now[0]-1, now[1]))
        if (now[0]+1, now[1]) in Possible_list:
            Adj_possible.append((now[0]+1, now[1]))
        if (now[0], now[1]-1) in Possible_list:
            Adj_possible.append((now[0], now[1]-1))
        if (now[0], now[1]+1) in Possible_list:
            Adj_possible.append((now[0], now[1]+1))
        
        for next_zahyou in Adj_possible:
            if Visited[Possible_list.index(next_zahyou)] != -1:
                continue
            Visited[Possible_list.index(next_zahyou)] = Visited[Possible_list.index(now)] + 1
            dq.append(next_zahyou)
    
    max_length = max(max_length, max(Visited))

print(max_length)

### FIXED CODE ###

from collections import deque

h, w = map(int, input().split())
S = [['#']*(w+2)]

for _ in range(h):
    s = str(input())
    new_s = ['#']
    for x in s:
        new_s.append(x)
    new_s.append('#')
    S.append(new_s)
S.append(['#']*(w+2))

Possible_list = []
for i in range(h+2):
    for j in range(w+2):
        if S[i][j] == '.':
            Possible_list.append((i,j))

max_length = 0

for zahyou in Possible_list:
    dq = deque()
    Visited = [-1 for _ in range(len(Possible_list))]
    Visited[Possible_list.index(zahyou)] = 0
    dq.append(zahyou)
    
    while dq:
        now = dq.popleft()
        
        Adj_possible = []
        if (now[0]-1, now[1]) in Possible_list:
            Adj_possible.append((now[0]-1, now[1]))
        if (now[0]+1, now[1]) in Possible_list:
            Adj_possible.append((now[0]+1, now[1]))
        if (now[0], now[1]-1) in Possible_list:
            Adj_possible.append((now[0], now[1]-1))
        if (now[0], now[1]+1) in Possible_list:
            Adj_possible.append((now[0], now[1]+1))
        
        for next_zahyou in Adj_possible:
            if Visited[Possible_list.index(next_zahyou)] != -1:
                continue
            Visited[Possible_list.index(next_zahyou)] = Visited[Possible_list.index(now)] + 1
            dq.append(next_zahyou)
    
    max_length = max(max_length, max(Visited))

print(max_length)
### BUGGY CODE ###

from bisect import bisect_left
n = int(input())
x = [int(input())]
for _ in range(n-1):
  a = int(input())
  if a <= x[0]:
    x.insert(0, a)
  else:
    index = bisect_left(x, a)-1
    x[index] = a
print(len(x))

### FIXED CODE ###

from bisect import bisect_right
n = int(input())
a = int(input())
x = [a * (-1)]
for _ in range(n-1):
  a = int(input()) * (-1)
  if a >= x[-1]:
    x.append(a)
  else:
    index = bisect_right(x, a)
    x[index] = a
print(len(x))
### BUGGY CODE ###

n=int(input())
a=list(map(int,input().split()))
# li=[0]*n
a.sort()
cnt=0

for i in range(n):
    print(a.count(i+1))


### FIXED CODE ###



n=int(input())
a=list(map(int,input().split()))
li=[0]*n

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

for i in range(n):
    print(li[i])
### BUGGY CODE ###

import os
import numpy as np
import sys
input = sys.stdin.readline
print = sys.stdout.write
import numpy as np

def main():
    def bit_add(arr, n, i, x):
        while i <= n:
            arr[i] += x
            i += i & -i

    def bit_sum(arr, i):
        result = 0
        while i > 0:
            result += arr[i]
            i ^= i & -i
        return result

    N, Q = map(int, input().split())
    C = list(map(int,input().split()))

    L, R = [], []
    for _ in range(Q):
        l, r = map(int, input().split())
        L.append(l-1);R.append(r-1)

    just_left = {}
    segments = []
    for i in range(N):
        c = C[i]
        if c in just_left:
            segments.append((i, 0, just_left[c], 0))
        just_left[c] = i

    for i in range(Q):
        segments.append((R[i], 1, L[i], i))

    segments.sort()
    bit = np.zeros(N + 2, dtype=np.int64)
    ans = np.zeros(Q, dtype=np.int64)

    for r, tp, l, i in segments:
        if tp == 0:
            bit_add(bit, N + 2, l + 2, 1)
        else:
            base = r - l + 1
            ans[i] = base - (bit_sum(bit, r + 2) - bit_sum(bit, l + 1))

    print("\n".join(map(str,ans)))
main()

### FIXED CODE ###

import numpy as np

def solve(inp):
    def bit_add(arr, n, i, x):
        while i <= n:
            arr[i] += x
            i += i & -i

    def bit_sum(arr, i):
        result = 0
        while i > 0:
            result += arr[i]
            i ^= i & -i
        return result

    N, Q = inp[:2]
    C = inp[2: 2+N]
    L, R = inp[2+N::2] - 1, inp[3+N::2] - 1

    just_left = {}
    segments = []
    for i in range(N):
        c = C[i]
        if c in just_left:
            segments.append((i, 0, just_left[c], 0))
        just_left[c] = i

    for i in range(Q):
        segments.append((R[i], 1, L[i], i))

    segments.sort()
    bit = np.zeros(N + 2, dtype=np.int64)
    ans = np.zeros(Q, dtype=np.int64)

    for r, tp, l, i in segments:
        if tp == 0:
            bit_add(bit, N + 2, l + 2, 1)
        else:
            base = r - l + 1
            ans[i] = base - (bit_sum(bit, r + 2) - bit_sum(bit, l + 1))

    return ans

def main():
    inp = np.fromstring(open(0).read(), dtype=np.int64, sep=' ')
    ans = solve(inp)
    print("\n".join(map(str,ans)))
    

def cc_export():
    from numba.pycc import CC
    cc = CC('my_module')
    cc.export('solve', '(i8[:],)')(solve)
    cc.compile()

if __name__ == '__main__':
    import sys
    if sys.argv[-1] == 'ONLINE_JUDGE':
        cc_export()
        exit(0)
    from my_module import solve
    main()
### BUGGY CODE ###

import sys
sys.setrecursionlimit(200000)

n = int(input())

#Adj_dict = {}
All_edges = []
# for i in range(n):
#     new = {i:[]}
#     Adj_dict.update(new)
Adj_dict= {i:[] for i in range(n)}

for _ in range(n-1):
    a, b = map(int, input().split())
    Adj_dict[a-1].append(b-1)
    Adj_dict[b-1].append(a-1)
    All_edges.append((a-1,b-1))

max_val_count = 0
start_node = 0
for key, val in Adj_dict.items():
    if len(val) >= max_val_count:
        max_val_count = len(val)
        start_node = key


Visited = [False for _ in range(n)]
Colors_use = [False for _ in range(max_val_count)]
Colors_use_raw = [False for _ in range(max_val_count)]

edges_colors = {}

def coloring(Adj_dict, start, Visited, Colors_use):
    
    # 終端処理
    if Visited[start]:
        return
    
    Visited[start] = True

    for node in Adj_dict[start]:
        if Visited[node] == False:
            color = Colors_use.index(False) + 1
            Colors_use[color-1] = True
            
            edge_color = {(min(node, start), max(node, start)): color}
            edges_colors.update(edge_color)
            
            New_Colors_use = Colors_use_raw.copy()
            New_Colors_use[color-1] = True
            
            coloring(Adj_dict, node, Visited, New_Colors_use)
    return

coloring(Adj_dict, start_node, Visited, Colors_use)

print(max_val_count)
for edge in All_edges:
    print(edges_colors[edge])

### FIXED CODE ###

from collections import deque

n = int(input())
Adj_dict = {x:[] for x in range(1,n+1)}
AB_dict = {}
AB = []
for _ in range(n-1):
    a, b = map(int, input().split())
    Adj_dict[a].append(b)
    Adj_dict[b].append(a)
    AB.append([a,b])
    AB_dict.update({str(a)+'_'+str(b):0})

max_edges = 0
node_max_edges = 0
for key, value in Adj_dict.items():
    edges = len(value)
    if edges >= max_edges:
        max_edges = edges
        node = key

dq = deque()
dq.append(1)

Visited = [False for _ in range(n+1)]
Visited[1] = True
Colors = [0 for _ in range(n+1)]

while dq:
    c = 1
    node = dq.popleft()
    Next_nodes = Adj_dict[node]

    for next_node in Next_nodes:
        if Visited[next_node] == True:
            continue
        dq.append(next_node)
        Visited[next_node] = True

        if c == Colors[node]:
            c += 1
        Colors[next_node] = c
        c += 1
        if node < next_node:
            AB_dict[str(node)+'_'+str(next_node)] = Colors[next_node]
        else:
            AB_dict[str(next_node)+'_'+str(node)] = Colors[next_node]

print(max_edges)
for ab in AB:
    a = ab[0]
    b = ab[1]
    print(AB_dict[str(a)+'_'+str(b)])
# print(AB_dict)
### BUGGY CODE ###

import sys

from itertools import combinations


def solve(n, pairs):
    def update(x, y):
        def f(srv):
            if x in srv:
                if y in srv:
                    return False
                else:
                    srv.add(y)
            elif y in srv:
                srv.add(x)
            return srv

        return f

    survivors = [{v} for v in range(1, n + 1)]
    for x, y in reversed(pairs):
        f = update(x, y)
        survivors = [srv for srv in survivors if f(srv)]
    return sum(su.isdisjoint(sv) for su, sv in combinations(survivors, 2))


n, m = map(int, input().split())
pairs = []
for line in sys.stdin.readlines():
    x, y = map(int, line.split())
    pairs.append((x, y))
print(solve(n, pairs))


### FIXED CODE ###

def get_survivors(n, pairs):
    survivors = {v: {v} for v in range(n)}
    for x, y in reversed(pairs):
        for v, srv in survivors.copy().items():
            if x in srv:
                if y in srv:
                    del survivors[v]
                else:
                    srv.add(y)
            elif y in srv:
                srv.add(x)
    return survivors


def solve(n, pairs):
    survivors = get_survivors(n, pairs)
    ans = 0
    for u, su in survivors.items():
        for v, sv in survivors.items():
            if u >= v:
                continue
            if su.isdisjoint(sv):
                ans += 1
    return ans


n, m = map(int, input().split())
pairs = []
for _ in range(m):
    x, y = map(int, input().split())
    x -= 1
    y -= 1
    pairs.append((x, y))
print(solve(n, pairs))
### BUGGY CODE ###

N=int(input())
A=list(map(int,input().split()))
A.sort()
b=A[:]
b=set(b)
cnt=len(A)
for j in b:
  x=A.count(j)
  if x==j:
    x=0
  elif x>j:
    for k in range(1,x-j+1):
      A.remove(j)
  elif x<j:
    for l in range(1,x+1):
      A.remove(j)
print(cnt-len(A))

### FIXED CODE ###

N=int(input())
A=list(map(int,input().split()))
C=[0]*100001
cnt=0
for i in range(N):
  if A[i]>10**5:
    cnt +=1
  else:
    C[A[i]] += 1
for j in range(100001):
  if C[j]<j:
    cnt=cnt+C[j]
  elif C[j]>j:
    cnt=cnt+C[j]-j
print(cnt)
### BUGGY CODE ###

import numpy as np
N,M=map(int,input().split(" "))
#Nはポーンの数 Mは入力の数
A=list(sorted(map(int,input().split(" "))))
L=np.array([A[s]-A[s+1] for s in range(M-1)])

if M<=N:
    print(0)
else:
    for s in range(N-1):
        L=np.delete(L,np.argmin(L))
    print(abs(sum(L)))

### FIXED CODE ###

N,M=map(int,input().split(" "))
A=list(sorted(map(int,input().split(" "))))
L=[A[s]-A[s+1] for s in range(M-1)]
if M>N:
    print(abs(sum(sorted(L)[N-1:])))
else:
    print(0)
### BUGGY CODE ###

import queue
import copy

N=int(input())
A=[[] for _ in range(N)]

for i in range(N):
    A[i]=list(map(int,input().split()))

NE=[0]*N#i番目の人が，次何番目の試合をするかのリスト
F=[0]*N#i番目の人が，該当する日に試合をしたか記憶しておく

#i+1日目の試合をする人はi日目に試合をした人なので，それを記憶．
q1=queue.Queue()
q2=queue.Queue()

#初日
for i in range(N):
    opp=A[i][0]-1
    if A[opp][0]-1==i:
        NE[i]+=1
        q1.put(i)

ans=1
#d日目
for d in range(N*(N-1)//2):
    F=[0]*N
    while not q2.empty():
        a=q2.get()
        q1.put(a)
    while not q1.empty():
        i=q1.get()
        if NE[i]==N-1:
            continue
        opp=A[i][NE[i]]-1
        if F[i]==1 or F[opp]==1:#その日に試合したことがある人はスルー,oppの重複防止
            continue
        if A[opp][NE[opp]]-1==i:
            NE[i]+=1
            NE[opp]+=1
            F[i]=1
            F[opp]=1
            if NE[i]!=N-1:
                q2.put(i)
            if NE[opp]!=N-1:
                q2.put(opp)
    ans+=1
    if q2.empty() and q2.empty():
        break

for i in range(N):
    if NE[i]!=N-1:
        ans=-1
print(ans)

### FIXED CODE ###

N=int(input())
A=[[] for _ in range(N)]

for i in range(N):
    A[i]=list(map(int,input().split()))

NE=[0]*N#i番目の人が，次何番目の試合をするかのリスト
F=[0]*N#i番目の人が，該当する日に試合をしたか記憶しておく

#i+1日目の試合をする人はi日目に試合をした人なので，それを2つのqueueに記憶．
Q=[[],[]]

#初日
for i in range(N):
    opp=A[i][0]-1
    if A[opp][0]-1==i:
        NE[i]+=1
        Q[0].append(i)

ans=1
#d日目
for d in range(N*(N-1)//2):
    F=[0]*N
    a=d%2
    b=(d+1)%2
    while len(Q[a])!=0:
        i=Q[a].pop()
        if NE[i]==N-1:
            continue
        opp=A[i][NE[i]]-1
        if F[i]==1 or F[opp]==1:#その日に試合したことがある人はスルー,oppの重複防止
            continue
        if A[opp][NE[opp]]-1==i:
            NE[i]+=1
            NE[opp]+=1
            F[i]=1
            F[opp]=1
            if NE[i]!=N-1:
                Q[b].append(i)
            if NE[opp]!=N-1:
                Q[b].append(opp)
    ans+=1
    if len(Q[a])==0 and len(Q[b])==0:
        break

for i in range(N):
    if NE[i]!=N-1:
        ans=-1
print(ans)
### BUGGY CODE ###

N, M, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
assert len(A) == N
assert len(B) == M
# K分以内に読む数の最大化

cumA = []
cumB = []
sumA = 0
sumB = 0
for a in A:
  sumA += a
  cumA.append(sumA)
for b in B:
  sumB += b
  cumB.append(sumB)

maximum = 0
for maxA,timeA in enumerate([0]+cumA):
  if timeA > K:
     break
  timeB = K - timeA
  maxB = [i for i,b in enumerate(cumB) if b <= timeB]
  maxB = max(maxB) + 1 if len(maxB) else 0
  maximum = max(maximum, maxA + maxB)
print(maximum)

### FIXED CODE ###

N , M, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
a,b=[0],[0]
for i in range(N): a.append(a[i] + A[i])
for i in range(M): b.append(b[i] + B[i])
ans,j=0,M
for i in range(N+1):
  if a[i]>K:
    break
  while b[j] > K - a[i]:
    j -= 1
  ans = max(ans, i+j)
print(ans)
### BUGGY CODE ###

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

ans = 0

while (n > 0):
    for i in range(a):
        if n < 1:
            break
        else:
            n -= 1
            ans += 1
    for i in range(b):
        if n < 1:
            break
        else:
            n -= 1

print(ans)


### FIXED CODE ###

n, a, b = map(int, input().split())
tmp = (n % (a+b))

if a == 0:
    print('0')
elif tmp == 0:
    print(a * (n // (a+b)))
else:
    if tmp < a:
        print(a * (n // (a+b)) + tmp)
    else:
        print(a * (n // (a+b)) + a)
### BUGGY CODE ###

import networkx as nx

G = nx.DiGraph()

N, M = map(int, input().split())
G.add_nodes_from(range(1, N + 1))
for _ in range(M):
    a, b, c = map(int, input().split())
    G.add_edge(a, b, weight=-c)

rev = G.reverse(copy=False)
c = nx.unweighted.single_source_shortest_path(rev, N).keys()
sG = G.subgraph(c)

try:
    print(-nx.bellman_ford_path_length(sG, 1, N))
except nx.NetworkXUnbounded:
    print('inf')


### FIXED CODE ###

from scipy.sparse.csgraph import connected_components, bellman_ford, NegativeCycleError
from scipy.sparse import csr_matrix

N, M = map(int, input().split())
frm, to, length = [], [], []
for _ in range(M):
    a, b, c = map(int, input().split())
    frm.append(a - 1)
    to.append(b - 1)
    length.append(-c)

# N-1→0の辺を追加してから卿連結判定⇒ゴールにたどり着けない閉路を除外
connect_check = csr_matrix(([1] * (M + 1), (frm + [N - 1], to + [0])), shape=(N, N))
_, labels = connected_components(connect_check, connection='strong')
label_num = labels[0]
frm_c, to_c, length_c = [], [], []
for i in range(M):
    if labels[frm[i]] == labels[to[i]] == label_num:
        frm_c.append(frm[i])
        to_c.append(to[i])
        length_c.append(length[i])

matr = csr_matrix((length_c, (frm_c, to_c)), shape=(N, N))

try:
    ans = -int(bellman_ford(matr, indices=0)[N - 1])
    print(ans)
except NegativeCycleError:
    print('inf')
### BUGGY CODE ###

from fractions import gcd
from functools import reduce
 
N = int(input())
A = list(map(int, input().split()))
 
MOD = 10 ** 9 + 7
 
lcm = reduce(lambda x,y: x*(y//gcd(x,y)), A)
 
answer = sum((lcm//x) % MOD for x in A)
answer %= MOD
print(answer)

### FIXED CODE ###

from fractions import gcd
from functools import reduce
 
N = int(input())
A = list(map(int, input().split()))
 
MOD = 10 ** 9 + 7
 
lcm = reduce(lambda x,y: x*(y//gcd(x,y)), A)
 
answer = sum(lcm//x for x in A)
answer %= MOD
print(answer)
### BUGGY CODE ###

import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

N = int(input())
mod = 10**9+7

from collections import defaultdict
from bisect import bisect_right
last = -1
dic = defaultdict(list)
idx = 0
lis = []
for i in range(N):
    c = int(input())
    if c==last:
        continue
    last = c
    dic[c].append(idx)
    lis.append(c)
    idx += 1
memo = {}
memo_s = set()
def dfs(i):
    if i==idx:
        return 1
    if i in memo_s:
        return memo[i]
    v = lis[i]
    ret = 0
    n_idx = bisect_right(dic[v], i)
    if n_idx<len(dic[v]):
        for nx in dic[v][n_idx:]:
            ret += dfs(nx+1)
            ret %= mod
    ret += dfs(i+1)
    ret %= mod
    memo[i] = ret
    memo_s.add(i)
    return ret
print(dfs(0))

### FIXED CODE ###

import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

N = int(input())
mod = 10**9+7

last = {}
dp = [0]*(N+1)
dp[0] = 1
for i in range(1, N+1):
    dp[i] = dp[i-1]
    c = int(input())
    if c in last and last[c]+1<i:
        dp[i] += dp[last[c]]
        dp[i] %= mod
    last[c] = i

print(dp[N])
### BUGGY CODE ###

[N,L] = [int(x) for x in input().split()]
A = [int(x) for x in input().split()]
count = 0
for i in range(N-2):
    if A[i] <= A[i+2] : count += 1
if count > N * 0.8 : print(1)
ans = []
mini = min(A[0:L])
ans.append(mini)
for i in range(1,N-L+1) :
    if A[i+L-1] <= mini :
        mini = A[i+L-1]
    elif A[i-1] == mini :
        mini = min(A[i:i+L])
    ans.append(mini)
for i in ans[:-1] : print(i, end=" ")
print(ans[-1])

### FIXED CODE ###

def ascend(a,b):
    mini = min(A[a:a+L])
    ans[a] = mini
    for i in range(a+1,b):
        if A[i+L-1] <= mini : mini = A[i+L-1]
        elif A[i-1] == mini : mini = min(A[i:i+L])
        ans[i] = mini

def descend(a,b):
    mini = min(A[b-1:b+L-1])
    ans[b-1] = mini
    for i in range(b-2,a-1,-1):
        if A[i] <= mini : mini = A[i]
        elif A[i+L] == mini: mini = min(A[i:i+L])
        ans[i] = mini
    
[N,L] = [int(x) for x in input().split()]
A = [int(x) for x in input().split()]
ans = [None]*(N-L+1)
count = 0;
if N > 10 ** 4:
    for i in range(100):
        if A[i+1] > A[i] : count += 1
    if count > 80 : descend(0, N-L+1)
    else : ascend(0,N-L+1)
else :
    ascend(0, N-L+1)
for i in ans[:-1] : print(i, end=" ")
print(ans[-1])
### BUGGY CODE ###

s = list(input())
s.reverse()
ret = 0 
while (s[0]=="B"):
    del s[0]
l = len(s)
nb = s.count("B")
for _ in range(nb):
    for i in range(l):
        if s[i] == "B":
            del s[i]
            ret += i
            break
print(ret)

### FIXED CODE ###

s = list(input())
s.reverse()
wl = 0 
rwl = 0 
ret = 0 
l = len(s)
for i in range(l):
    if s[i] == "W":
        wl += 1
    else:
        ret += rwl + wl
        rwl += wl
        wl = 0 
print(ret)
### BUGGY CODE ###

from collections import deque

H,W = map(int,input().split())

by,bx= deque(),deque()
Map = []
Map.append('@'*(W+2))
for i in range(H):
  c = list('@'+input()+'@')
  Map.append(c)
  for j in range(W+2):
    if(c[j] == '#'):
      Map[i+1][j] = 0
      by.append(i+1),bx.append(j)
Map.append('@'*(W+2))      

cnt = 0
while(1):
  if(len(by) == 0):
    cnt = Map[ny][nx]
    break
   
  ny,nx = by.popleft(),bx.popleft()
  vec_y,vec_x = [1,-1,0,0],[0,0,1,-1]
  for i in range(4):
      if(Map[ny+vec_y[i]][nx+vec_x[i]] == '.'):
         Map[ny+vec_y[i]][nx+vec_x[i]] = Map[ny][nx] + 1
         by.append(ny+vec_y[i]),bx.append(nx+vec_x[i])
  
print(cnt)  

### FIXED CODE ###

from collections import deque

H,W = map(int,input().split())

by,bx= deque(),deque()
Map = []
Map.append('@'*(W+2))
for i in range(H):
  c = list('@'+input()+'@')
  Map.append(c)
  for j in range(W+2):
    if(c[j] == '#'):
      Map[i+1][j] = 0
      by.append(i+1),bx.append(j)
Map.append('@'*(W+2))      

cnt = 0
while(1):
  if(len(by) == 0):
    break
   
  ny,nx = by.popleft(),bx.popleft()
  vec_y,vec_x = [1,-1,0,0],[0,0,1,-1]
  for i in range(4):
      if(Map[ny+vec_y[i]][nx+vec_x[i]] == '.'):
         Map[ny+vec_y[i]][nx+vec_x[i]] = Map[ny][nx] + 1
         cnt = max(cnt, Map[ny][nx] + 1) 
         by.append(ny+vec_y[i]),bx.append(nx+vec_x[i])
  
print(cnt)
### BUGGY CODE ###

n = int(input())
sl = []
s_count = []

for i in range(n):
    s = input()
    if not(s in sl):
        sl.append(s)
        s_count.append(1)
    else:
        index = sl.index(s)
        s_count[index] += 1

ans = []
s_max = max(s_count)
for i in range(len(s_count)):
    if s_count[i] == s_max:
        ans.append(sl[i])

ans.sort()
for a in ans:
    print(a)


### FIXED CODE ###

n = int(input())
sl = {}

for i in range(n):
    s = input()
    if not(s in sl):
        sl[s] = 0
    else:
        sl[s] += 1

ans = []
s_max = max(sl.values())
for key in sl:
    if sl[key] == s_max:
        ans.append(key)

ans.sort()
for a in ans:
    print(a)
### BUGGY CODE ###

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

copy = num_list.copy()
copy.sort()

ans_list = [0]*n
for i in range(len(copy)):
    ans_list[i] = str(num_list.index(copy[i]) + 1)

ans = ' '.join(ans_list)
print(ans)

### FIXED CODE ###

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

ans_list = [0]*n
for i, j in enumerate(num_list):
    ans_list[j-1] = str(i+1)

ans = ' '.join(ans_list)
print(ans)
### BUGGY CODE ###

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

s=[[0]*N for i in range(N)]
k=0
while(k<N-1):
  i=k+1
  while(i<N):
    j=0
    while(i+j<N and k+j < i):
      if S[i+j]==S[j+k]:
        j+=1
      else:
        break
    s[k][i]=j
    i+=1
  k+=1
ans=0
for i in range(N):
  ans=max(ans,max(s[i]))
print(ans)
      
 


### FIXED CODE ###

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

def z_algo(S):
    N = len(S)
    A = [0]*N
    i = 1; j = 0
    A[0] = l = len(S)
    while i < l:
        while i+j < l and S[j] == S[i+j]:
            j += 1
        if not j:
            i += 1
            continue
        A[i] = j
        k = 1
        while l-i > k < j - A[k]:
            A[i+k] = A[k]
            k += 1
        i += k; j -= k
    return A

s=[[0]*N for i in range(N)]
k=0
for k in range(N):
  s[k]= [0]*k + z_algo(S[k:])

ans=0
for i in range(N):
  for j in range(i+1,N):
    if s[i][j]+i > j:
      ans = max(ans,j - i)
    else:
      ans=max(s[i][j],ans)
    
print(ans)
### BUGGY CODE ###

if __name__ == "__main__":
    N, K = list(map(int, input().split()))
    A = list(map(int, input().split()))

    flag = 0
    for i in range(K, N):
        if flag==0:
            mae = 1
            for j in range(i-K, i-1):
                mae = mae * A[j]
            ato = mae / A[i-K] * A[i]
            flag=1
        else:
            ato = mae / A[i-K] * A[i]

        if mae < ato:
            print("Yes")
        else:
            print("No")
        
        mae = ato
        
        

### FIXED CODE ###

import numpy as np

if __name__ == "__main__":
    N, K = list(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")