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

s = [ord(c) - 97 for c in input()]
t = [ord(c) - 97 for c in input()]
sl = len(s)
tl = len(t)
rr = [[0] * (tl) for _ in range(sl)]
t0 = t[0]

# init
for i in range(sl):
    if s[i] == t0:
        for k in range(i,sl):
            rr[k][0] = 1
        break

rr0 = rr[0]
s0 = s[0]
for j in range(tl):
    if s0 == t[j]:
        for k in range(j,tl):
            rr0[k] = 1
        break

# solve
ta = [(i,t[i]) for i in range(1, tl)]
for i in range(1, sl):
    rri = rr[i]
    rri1 = rr[i-1]
    si = s[i]
    for j, tj in ta:
        if si == tj:
            rri[j] = rri1[j-1] + 1
        else:
            rri[j] = rri1[j]
            if rri[j] < rri[j-1]:
                rri[j] = rri[j-1]

# restore
i = sl-1
j = tl-1
r = []
while i >= 0 and j >= 0:
    if s[i] == t[j]:
        r.append(s[i] + 97)
        i -= 1
        j -= 1
        continue
    if rr[i][j] == 0:
        break
    if i > 0 and rr[i-1][j] == rr[i][j]:
        i -= 1
    else:
        j -= 1

ans = ''.join(map(chr,r[::-1]))
print(ans)


### FIXED CODE ###

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

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)


def main():
    s = [c for c in S()]
    t = [c for c in S()]
    sl = len(s)
    tl = len(t)
    rr = [[0] * (tl) for _ in range(sl)]
    for i in range(sl):
        for j in range(tl):
            if s[i] == t[j]:
                if i > 0 and j > 0:
                    rr[i][j] = rr[i-1][j-1] + 1
                else:
                    rr[i][j] = 1
                continue

            m = 0
            if i > 0:
                m = rr[i-1][j]
            if j > 0 and m < rr[i][j-1]:
                m = rr[i][j-1]
            rr[i][j] = m

    i = sl-1
    j = tl-1
    r = []
    while i >= 0 and j >= 0:
        if s[i] == t[j]:
            r.append(s[i])
            i -= 1
            j -= 1
            continue
        if rr[i][j] == 0:
            break
        if i > 0 and rr[i-1][j] == rr[i][j]:
            i -= 1
        else:
            j -= 1

    return ''.join(r[::-1])


print(main())
### BUGGY CODE ###

#!/usr/bin/env python3
from collections import deque, Counter
from heapq import heappop, heappush
from bisect import bisect_right
from itertools import accumulate

def main():
    N, K = map(int, input().split())
    A = list(map(int, input().split()))
    # print(A)
    for i in range(K):
        
        B = [0] * N
        for j in range(N):
            B[max(j-A[j],0)] += 1
            if j+A[j]+1 < N:
                B[j+A[j]+1] -= 1
            # print(j,B)
        A = list(accumulate(B[:]))
        if A == [N]*N:
            break
    print(*A)

if __name__ == "__main__":
    main()


### FIXED CODE ###

#!/usr/bin/env python3
from collections import deque, Counter
from heapq import heappop, heappush
from bisect import bisect_right
from itertools import accumulate
import math

def main():
    N, K = map(int, input().split())
    A = list(map(int, input().split()))
    mina = min(A)
    for i in range(K):
        B = [0]*N
        for j in range(N):
            if j-A[j] >= 0:
                B[j-A[j]] += 1
            else:
                B[0] += 1
            if j+A[j]+1 < N:
                B[j+A[j]+1] -= 1
        A = list(accumulate(B[:]))
        mina = mina*2+1
        if mina >= N and A[0] == A[-1] == N:
            break
    print(*A)

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

import sys
from collections import defaultdict

h,w,m = map(int, sys.stdin.readline().split())
targets = [list(map(lambda x: int(x)-1, sys.stdin.readline().split())) for _ in range(m)]

num_in_h = defaultdict(int)
num_in_w = defaultdict(int)
for t in targets:
    num_in_h[t[0]] += 1
    num_in_w[t[1]] += 1

max_h_list = [kv for kv in num_in_h.items() if kv[1] == max(num_in_h.values())]
max_w_list = [kv for kv in num_in_w.items() if kv[1] == max(num_in_w.values())]
ans = max(num_in_h.values()) + max(num_in_w.values())

#print([max_h[0], max_w[0]] in targets)
flag = False
for h in max_h_list:
    for w in max_w_list:
        if [h[0], w[0]] not in targets:
            flag = True
            break

print(ans if flag == True else ans-1)


### FIXED CODE ###

import sys

h,w,m = map(int, sys.stdin.readline().split())
num_in_h = [0] * h
num_in_w = [0] * w
targets = set()
for _ in range(m):
    t_h, t_w = map(lambda x: int(x)-1, sys.stdin.readline().split())
    num_in_h[t_h] += 1
    num_in_w[t_w] += 1
    targets.add((t_h, t_w))

max_h = max(num_in_h)
max_w = max(num_in_w)
max_h_set = set([i for i, v in enumerate(num_in_h) if v == max_h])
max_w_set = set([i for i, v in enumerate(num_in_w) if v == max_w])
ans = max_h + max_w - 1

flag = False
for i in max_h_set:
    for j in max_w_set:
        if (i, j) not in targets:
            flag = True
            break
    if flag: break

print(ans+1 if flag else ans)
### BUGGY CODE ###

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

A.sort()

for i in range(M):
        tmp = A.pop(-1) // 2
        index = bisect.bisect_left(A, tmp)
        A.insert(index, tmp)


print(sum(A))

### FIXED CODE ###


import heapq
N, M = map(int, input().split())
A = list(map(lambda x: int(x) * (-1), input().split()))

heapq.heapify(A)

for i in range(M):
        tmp = int(heapq.heappop(A) / 2)
        heapq.heappush(A, tmp)

print(sum(A) * -1)
### BUGGY CODE ###

N = int(input())
count =1
for i in range(1,N+1):
    count *=i
print(count%(10**9+7))

### FIXED CODE ###

n = int(input())
mod = 10**9+7
ans = 1
for i in range(1, n+1):
  ans *= i
  ans %= mod
print(ans)
### BUGGY CODE ###

def main():
  if 'get_ipython' not in globals():  
    # For Subsession
    X, Y, Z, K = (int(i) for i in input().split())
    A = [int(i) for i in input().split()] 
    B = [int(i) for i in input().split()]
    C = [int(i) for i in input().split()] 
  else:
    A = [1,10,100]
    B = [2,20,200]
    C = [1,10,100]
    #A = [4,6]
    #B = [1,5]
    #C = [3,8]
    X = len(A)
    Y = len(B)
    Z = len(C)
    K = 5
    #K = 8

  # Processing
  # A.sort(reverse=True)
  # B.sort(reverse=True)
  
  AB = []
  for i in A:
    for j in B:
      AB.append(i+j)
  
  AB.sort(reverse=True)
  if 'get_ipython' in globals(): 
    print(AB)
  
  ABC = []
  C.sort(reverse=True)
  for i in AB[0:K]:
    for j in C[0:K]:
      ABC.append(i+j)  
  
  ABC.sort(reverse=True)
  
  if 'get_ipython' in globals(): 
    print(ABC)

  for i in ABC[0:K]:
    print(i)      

main()

### FIXED CODE ###

def main():
  if 'get_ipython' not in globals():  
    # For Subsession
    X, Y, Z, K = (int(i) for i in input().split())
    A = [int(i) for i in input().split()] 
    B = [int(i) for i in input().split()]
    C = [int(i) for i in input().split()] 
  else:
    A = [1,10,100]
    B = [2,20,200]
    C = [1,10,100]
    #A = [4,6]
    #B = [1,5]
    #C = [3,8]
    X = len(A)
    Y = len(B)
    Z = len(C)
    K = 5
    #K = 8

  # Processing
  AB = []
  A.sort(reverse=True)
  B.sort(reverse=True)
  for i in A[0:K]:
    for j in B[0:K]:
      AB.append(i+j)
  
  AB.sort(reverse=True)
  
  ABC = []
  C.sort(reverse=True)
  
  for i in AB[0:K]:
    for j in C[0:K]:
      ABC.append(i+j)  
  
  ABC.sort(reverse=True)

  for i in ABC[0:K]:
    print(i)      

main()
### BUGGY CODE ###

from itertools import product

N = int(input())
*V, = map(int, input().split())
*C, = map(int, input().split())

ans = -10**18
for p in product([0, 1], repeat=N):
    res = 0
    for i, e in enumerate(p):
        if e:
            res += V[i] - C[i]
    ans = max(ans, res)
print(ans)

### FIXED CODE ###

from itertools import product

N = int(input())
*V, = map(int, input().split())
*C, = map(int, input().split())

ans = -10**18
for p in product([0, 1], repeat=N):
    res = 0
    for i, e in enumerate(p):
        if e:
            res += V[i] - C[i]
    ans = max(ans, res)
print(ans)
### BUGGY CODE ###

# https://atcoder.jp/contests/abc068/tasks/arc079_a

import itertools
from collections import Counter
from collections import defaultdict
import bisect

def main():
    N, M = map(int, input().split())
    s_list = []
    g_list = []

    for _ in range(M):
        a, b = map(int, input().split())
        if a == 1:
            s_list.append(b)
        if b == N:
            g_list.append(a)

    for s in s_list:
        if s in g_list:
            print("POSSIBLE")
            exit()
    print("IMPOSSIBLE")


if __name__ == '__main__':
    main()


### FIXED CODE ###

# https://atcoder.jp/contests/abc068/tasks/arc079_a

import itertools
import collections
import bisect

def main():
    N, M = map(int, input().split())

    src = {}
    A = []
    B = []
    for _ in range(M):
        a, b = map(int, input().split())
        A.append(a)
        B.append(b)

        if a == 1:
            src[b] = 1

    for i in range(M):
        if A[i] in src and B[i] == N:
            print("POSSIBLE")
            exit()

    print("IMPOSSIBLE")


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

from copy import deepcopy
s = ['_']
s.extend(list(input()))
t = ['.']
t.extend(list(input()))
N = len(s)
M = len(t)
DP = [[[0,[]] for j in range(M+1)] for i in range(N+1)]
for i in range(1,N+1):
    for j in range(1,M+1):
        if s[i-1] == t[j-1]:
            DP[i][j] = deepcopy(DP[i-1][j-1])
            DP[i][j][0] += 1
            DP[i][j][1].append(s[i-1])
        else:
            DP[i][j] = deepcopy(DP[i-1][j]) if DP[i-1][j][0] >= DP[i][j-1][0] else deepcopy(DP[i][j-1])
print(*DP[N][M][1],sep="")



### FIXED CODE ###

from copy import deepcopy
s = ['_']
s.extend(list(input()))
t = ['.']
t.extend(list(input()))
N = len(s)
M = len(t)
DP = [[0]*(M+1) for i in range(N+1)]
for i in range(1,N+1):
    for j in range(1,M+1):
        if s[i-1] == t[j-1]:
            DP[i][j] = DP[i-1][j-1]+1
        else:
            DP[i][j] = max(DP[i-1][j],DP[i][j-1])

i = N
j = M
ans = []
while i != 0 and j != 0:
    if DP[i-1][j] < DP[i][j] and DP[i][j-1] < DP[i][j]:
        ans.append(s[i-1])
        i -= 1
        j -= 1
    elif DP[i-1][j] == DP[i][j]:
        i -= 1
    elif DP[i][j-1] == DP[i][j]:
        j -= 1

print(*reversed(ans),sep="")
### BUGGY CODE ###

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

C = []

for i in range(N):
    for j in range(N):
        if i+1 == A[j]:
            C.append(j+1)

print(' '.join(map(str, C)))


### FIXED CODE ###

import numpy as np

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

C = np.argsort(A) + 1

print(' '.join(map(str, C)))
### BUGGY CODE ###

n=int(input())
a=list(map(int,input().split()))
keta=[0 for i in range(61)]
ans=0
for i in range(n):
  b=a[i]
  cnt=0
  while(b>=1):
    if b%2==1:
      keta[cnt]+=1
    b=b//2
    cnt+=1
#print(keta)
for i in range(61):
  #print(keta[i])
  #print(keta[i]*(n-keta[i])*(2**i))
  ans+=(keta[i]*(n-keta[i])*(2**i))%(1000000007)
while(ans>1000000007):
  ans%=1000000007
print(ans)

### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
keta=[0 for i in range(61)]
ans=0
for i in range(n):
  b=a[i]
  cnt=0
  while(b>=1):
    if b%2==1:
      keta[cnt]+=1
    b=b//2
    cnt+=1
#print(keta)
for i in range(61):
  #print(keta[i])
  #print(keta[i]*(n-keta[i])*(2**i))
  ans+=(keta[i]*(n-keta[i])*(2**i))%(1000000007)
while(ans>1000000007):
  ans%=1000000007
print(ans)
### BUGGY CODE ###

 
n = int(input())

a = [int(input()) for i in range(n)]

color = [[-1] for i in range(n+1)]

max_j = 0
for i in range(n):
    for j in range(n):
        #print(color[j][-1])
        if a[i] > color[j][-1]:
            color[j].append(a[i])
            max_j = max(max_j,j+1)
            break
            
print(max_j)

### FIXED CODE ###

import sys
input = sys.stdin.readline

from collections import deque

import bisect
n = int(input())

a = [int(input()) for i in range(n)]

#color = [a[0]]

d = deque()
d.appendleft(a[0])

for i in range(1,n):
    idx = bisect.bisect_left(d,a[i])
    if idx == 0:
        d.appendleft(a[i])
    else:
        d[idx-1] = a[i]
        
print(len(d))
### BUGGY CODE ###

def dfs (i,depth):

    if i >= depth-1:
        return 'bpppb'
    else:
        return 'b' + dfs(i+1,depth) + 'p' + dfs(i+1,depth) + 'b'

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

r = dfs(0,n)
print(r.count('p',0,x))


### FIXED CODE ###

a = []
p = []

def dfs (x,i,depth):

    if i <= 1:
        #print(x)
        if x == 0:
            return 0
        elif x == 1:
            return 1
        elif x == 2:
            return 2
        elif x >= 3:
            return 3
    else:
        #print(a[i],a[i]//2,x)
        if a[i]//2 < x  :
            x = x - a[i]//2 - 1
            #print("right>>>",p[i-1] + 1,x)
            return (p[i-1] + 1) + dfs(x,i-1,depth)
        elif a[i]//2 == x :
            #print("<<<mid>>>",1,x)
            return (1 + dfs(x-1,i-1,depth))
        else:
            #print("left<<<",0,x)
            if x - 1 <= 0:
                return 0
            else:
                return dfs(x-1,i-1,depth)

def ddff (i,depth):
    if i >= depth-1:
        return 'bpppb'
    else:
        return 'b' + ddff(i+1,depth) + 'p' + ddff(i+1,depth) + 'b'
 
n,x = map(int,input().split())

for i in range(n+1):
    p.append(2**(i+1)-1)
    b = 2**(i+1)-2
    a.append(p[i] + b)
#print(a,p)

r = dfs(x-1,n,n)
print(r)
### BUGGY CODE ###

n = int(input())
a = list(map(int, input().split()))
ans = 0
for i in range(n):
  for j in range(i+a[i], n):
    if abs(i- j) == a[i] + a[j]:
      ans += 1
    
print(ans)

### FIXED CODE ###

from collections import Counter
n = int(input())
a = list(map(int, input().split()))
l = [i + a[i] for i in range(n)]
r = [i - a[i] for i in range(n)]
countl = Counter(l)
countr = Counter(r)
ans = sum([countl[i]*countr[i] for i in countl.keys()])
print(ans)
### BUGGY CODE ###

def MAP(): return list(map(int,input().split()))
def INT(): return int(input())
def FLOAT(): return float(input())
MOD = 10**9+7

N,M = MAP()
Y = [0]*(10**5)
P = [0]*(10**5)
yd =[[] for _ in range(N)]
for i in range(M):
    p,y = MAP()
    P[i] = p-1
    Y[i] = y
    yd[p-1].append(y)

for i in range(N):
    yd[i].sort()

for i in range(M):
    print("{0:06d}".format(P[i]+1),end="")
    print("{0:06d}".format(yd[P[i]].index(Y[i])+1))

### FIXED CODE ###

import math
import collections
import itertools
import sys
import bisect
from heapq import heappop,heappush,heapify
sys.setrecursionlimit(10**6)
def MAP(): return list(map(int,input().split()))
def INT(): return int(input())
def FLOAT(): return float(input())
MOD = 10**9+7

N,M = MAP()
Y = [0]*(10**5)
P = [0]*(10**5)
yd =[[] for _ in range(N)]
for i in range(M):
    p,y = MAP()
    P[i] = p-1
    Y[i] = y
    yd[p-1].append(y)

for i in range(N):
    yd[i].sort()

for i in range(M):
    print("{0:06d}".format(P[i]+1),end="")
    print("{0:06d}".format(bisect.bisect_left(yd[P[i]],Y[i])+1))
### BUGGY CODE ###

input()
S = list(input())
count = 0
for mask in range(1, 2 << len(S)-1):
	temp = {}
	for i, v in enumerate(S):
		if 0 != mask & (1 << i):
			if v in temp:
				break
			temp[v] = True
	else:
		count += 1
print(count)


### FIXED CODE ###

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

mod = 10**9+7
R = 1
for w in set(S):
	#print(w, S.count(w))
	R *= S.count(w) + 1
	R %= mod
print(R - 1)
### BUGGY CODE ###

N=int(input())
X=list(input())
m=0
onecount=0
for i in range(N):
  d=N-1-i
  if X[i]=='1':
    m+=2**d
    onecount+=1

def f(x):
  result={}
  result[0]=0
  result[1]=1
  if x in result:
    return result[x]
  else:
    a=str(bin(x))
    b=a.count('1')
    d=x%b
    result[a]=f(d)+1
    return f(d)+1
  
for i in range(N):
  d=N-1-i
  if X[i]=='0':
    D=m+2**d
  else:
    D=m-2**d
  print(f(D))

### FIXED CODE ###

N=int(input())
X=input()
a=int(X,2)

def popcount(x):
  return bin(x).count("1")
p=X.count('1')

pl=a%(p+1)
if p!=1:
  mi=a%(p-1)

def f(x):
  if x==0:
    return 1
  else:
    return f(x%popcount(x))+1

for i in range(N):
  if X[i]=='0':
    b=pl
    b+=pow(2,N-i-1,p+1)
    b%=p+1
  else:
    if p!=1:
      b=mi
      b-=pow(2,N-i-1,p-1)
      b%=p-1
    else:
      print(0)
      continue
  print(f(b))
### BUGGY CODE ###

import heapq
# python template for atcoder1
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline

N, M, L = map(int, input().split())
roads = [[float('inf')]*N for _ in range(N)]
kyuyu = [[float('inf')]*N for _ in range(N)]
for _ in range(M):
    a, b, c = map(int, input().split())
    if c <= L:  # 移動出来ない経路は消す
        roads[a-1][b-1] = c
        roads[b-1][a-1] = c

for k in range(N):
    for i in range(N):
        for j in range(N):
            roads[i][j] = min(roads[i][j], roads[i][k]+roads[k][j])

for i in range(N):
    for j in range(N):
        if roads[i][j] <= L:
            kyuyu[i][j] = 1

for k in range(N):
    for i in range(N):
        for j in range(N):
            kyuyu[i][j] = min(kyuyu[i][j], kyuyu[i][k]+kyuyu[k][j])

Q = int(input())
for _ in range(Q):
    s, t = map(lambda x: int(x)-1, input().split())
    dist = kyuyu[s][t]
    if dist == float('inf'):
        print(-1)
    else:
        print(dist-1)


### FIXED CODE ###

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


def WF(mat, N):
    for k in range(N):
        for i in range(N):
            for j in range(N):
                mat[i][j] = min(mat[i][j], mat[i][k]+mat[k][j])
    return mat


N, M, L = map(int, input().split())
roads = [[float('inf')]*N for _ in [0]*N]
kyuyu = [[float('inf')]*N for _ in [0]*N]
for _ in range(M):
    a, b, c = map(int, input().split())
    roads[a-1][b-1] = c
    roads[b-1][a-1] = c

roads = WF(roads, N)
for i in range(N):
    for j in range(i+1, N):
        if roads[i][j] <= L:
            kyuyu[i][j] = 1
            kyuyu[j][i] = 1
kyuyu = WF(kyuyu, N)
Q = int(input())
for _ in range(Q):
    s, t = map(lambda x: int(x)-1, input().split())
    dist = kyuyu[s][t]
    if dist == float('inf'):
        print(-1)
    else:
        print(dist-1)
### BUGGY CODE ###

s = input()
cnt = 0

while s.count('BW'):
    cnt += s.count('BW')
    s = s.replace('BW', 'WB')
print(cnt)

### FIXED CODE ###

s = input()
cnt = 0
b_cnt = 0
for c in s:
    if c == 'B':
        b_cnt += 1
    else:
        cnt += b_cnt
print(cnt)
### BUGGY CODE ###

def knapsack(i,w):
    if dp[i][w]!=-1:
        return dp[i][w]
    else:
        if w-wi[i]>=0:
            dp[i][w] = max(knapsack(i-1,w-wi[i])+v[i],knapsack(i-1,w))
        else:
            dp[i][w] = knapsack(i-1,w)
        return dp[i][w]
n,w= map(int,input().split())
wi=[0]
v=[0]
for i in range(n):
    x,y= map(int,input().split())

    wi.append(x)
    v.append(y)
dp = [[-1 for i in range(w+1)] for j in range(n+1)]
for i in range(w+1):
    dp[0][i]=0
for j in range(n+1):
    dp[j][0]=0
print(knapsack(n,w))
#print(dp)

### FIXED CODE ###

N,W=map(int,input().split())
dp=[-1]*(W+1)
dp[0]=0
for _ in range(N):
    w,v=map(int,input().split())
    for i in range(W+1)[::-1]:
        if dp[i]!=-1 and i+w<=W:
            dp[i+w]=max(dp[i+w],dp[i]+v)
print(max(dp))
### BUGGY CODE ###

def resolve():
    H, W = map(int, input().split())
    s = [input() for _ in range(H)]

    def bfs(row, col, R, C, s):
        from collections import deque
        q = deque()
        q.append([(row, col), 0])
        seen = set()
        ans = 0
        while q:
            (r, c), dist = q.popleft()
            ans = max(dist, ans)
            seen.add((r, c))
            for (next_r, next_c) in ((r+1, c), (r-1, c), (r, c+1), (r, c-1)):
                if (next_r, next_c) not in seen and \
                    0 <= next_r < R and 0 <= next_c < C and \
                   s[next_r][next_c] == '.':
                    q.append([(next_r, next_c), dist + 1])
        return ans

    max_v = 0
    for h in range(H):
        for w in range(W):
            if s[h][w] == '.':
                max_v = max(max_v, bfs(h, w, H, W, s))
    print(max_v)
resolve()

### FIXED CODE ###

def resolve():
    H, W = map(int, input().split())
    s = [input() for _ in range(H)]
    from collections import defaultdict
    cnt = defaultdict(int)
    for item in s:
        for c in item:
            cnt[c] += 1
    if '#' not in cnt:
        print(H+W-2)
        quit()

    def bfs(row, col, R, C, s):
        from collections import deque
        q = deque()
        q.append([(row, col), 0])
        seen = set()
        ans = 0
        while q:
            (r, c), dist = q.popleft()
            ans = max(dist, ans)
            seen.add((r, c))
            for (next_r, next_c) in ((r+1, c), (r-1, c), (r, c+1), (r, c-1)):
                if (next_r, next_c) not in seen and \
                    0 <= next_r < R and 0 <= next_c < C and \
                   s[next_r][next_c] == '.':
                    q.append([(next_r, next_c), dist + 1])
        return ans

    max_v = 0
    for h in range(H):
        for w in range(W):
            if s[h][w] == '.':
                max_v = max(max_v, bfs(h, w, H, W, s))
    print(max_v)
resolve()
### BUGGY CODE ###

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

mod = 10**9+7

mm0 = [0 for i in range(60)]
mm1 = [0 for i in range(60)]

for i in range(n):
    for j in range(60):
        if (a[i]>>j)<0:
            break
        if (a[i]>>j)&1:
            mm1[j] += 1

ans = 0
for i in range(60):
    ttl = ((n-mm1[i])*mm1[i])
    ans += (((1<<i)%mod)*((ttl)%mod))%mod
    ans %= mod

print(ans)


### FIXED CODE ###

n = int(input())
a = list(map(int,input().split()))
 
mod = 10**9+7
 
 
 
ans = 0
q2 = 1
for j in range(60):
    mm1 = 0
    for i in range(n):
        if a[i]>>j&1:
            mm1 += 1
 
    ttl = ((n-mm1)*mm1)
    ans += ((q2)*((ttl)%mod))%mod
    ans %= mod
    q2 = (q2*2)%mod
 
print(ans)
### BUGGY CODE ###

a, b, k = map(int, input().split())
for i in range(a, b+1):
    if i < a+k or b-k < i:
        print(i)


### FIXED CODE ###

a, b, k = map(int, input().split())
l = []
for i in range(a, min(a+k, b+1)):
    l.append(i)
for i in range(max(a, b-k+1), b+1):
    l.append(i)
l = sorted(set(l))
for i in l:
    print(i)
### BUGGY CODE ###

def solve():
    n,k=input().split()
    A=list(map(int,input().split()))
    n=int(n)
    k=int(k)
    M=[]
    a=[1]*(n+1)
    for i in range(len(A)):
        a[i+1]=A[i]*a[i]
    # print(a)
    for i in range(0,n-k+1):
        s=1
        # for j in range(i,i+k):
        #     s=s*A[j]
        s=a[i+k]//a[i]
        M.append(s)
    # print(M)      
    for i in range(1,len(M)):
        if M[i]>M[i-1]:
            print("Yes")
        else:
            print("No")

solve()

### FIXED CODE ###

def solve():
    n,k=input().split()
    A=list(map(int,input().split()))
    n=int(n)
    k=int(k)
    for i in range(n-k):
        if A[i+k]>A[i]:
            print("Yes")
        else:
            print("No")

solve()