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

n,k = map(int,input().split())
a = {}
s = 0
for i in input().split():
    a[int(i)] = a.get(int(i),0)+1
b = list(a.values())
while(k<len(b)):
    c = min(b)
    s+=c
    b.remove(c)
print(s)

### FIXED CODE ###

n,k = map(int,input().split())
a = {}
for i in input().split():
    a[int(i)] = a.get(int(i),0)+1
b = list(a.values())
b.sort()
print(sum(b[:len(b)-k]))
### BUGGY CODE ###

# -*- coding: utf-8 -*-

# AtCoder Beginner Contest
# Problem C


# See:
# https://qiita.com/suecharo/items/30f5d817da4c948c3be6
def quick_sort(arr):
    left = []
    right = []
    if len(arr) <= 1:
        return arr

    ref = arr[0]
    ref_count = 0

    for ele in arr:
        if ele < ref:
            left.append(ele)
        elif ele > ref:
            right.append(ele)
        else:
            ref_count += 1
    left = quick_sort(left)
    right = quick_sort(right)
    return left + [ref] * ref_count + right


if __name__ == '__main__':
    n = int(input())
    x = list(map(int, input().split()))
    order = list(x)

    for i in range(n):
        tmp = order[i]
        x.remove(tmp)
        x = quick_sort(x)
        print(x[(n // 2) - 1])
        x.append(tmp)


### FIXED CODE ###

# -*- coding: utf-8 -*-

# AtCoder Beginner Contest
# Problem C

if __name__ == '__main__':
    n = int(input())
    x = list(map(int, input().split()))
    sorted_x = sorted(x)

    low = sorted_x[(n // 2) - 1]
    high = sorted_x[(n // 2)]

    for i in range(n):
        if x[i] < high:
            print(high)
        else:
            print(low)
### BUGGY CODE ###

import sys
import numpy as np
from fractions import gcd

input = sys.stdin.buffer.readline

LARGE = 10 ** 9 + 7

def lcm(x, y):
    return (x * y) // gcd(x, y)

input()
A = list(map(int, input().split()))
l = 1
for a in A:
    l = lcm(l, a)

print((l // np.array(A, dtype=np.int64)).sum() % LARGE)


### FIXED CODE ###

import sys
from fractions import gcd

input = sys.stdin.buffer.readline

LARGE = 10 ** 9 + 7

def lcm(x, y):
    return (x * y) // gcd(x, y)

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

l = 1
for a in A:
    l = lcm(l, a)

total = 0
for a in A:
    total += l // a

print(total % LARGE)
### BUGGY CODE ###

n,p = list(map(int,input().split()))
S = input()

if p == 2 or p == 5:
  ans = 0
  for i,s in enumerate(S):
    if int(s)%p == 0:
      ans += i+1
  print(ans)
  exit()

def MS(i,s,pre):
  return (int(s)*i+pre)%p
 
M = [0]*p
M[0] = 1
i = 1
pre = 0
for s in S[::-1]:
  pre = MS(i,int(s),pre)
  M[pre] += 1
  i *= 10

ans = sum(map(lambda m:(m*(m-1))//2, M))
print(ans)



### FIXED CODE ###

n,p = list(map(int,input().split()))
S = input()

if p == 2 or p == 5:
  ans = 0
  for i,s in enumerate(S):
    if int(s)%p == 0:
      ans += i+1
  print(ans)
  exit()

def MS(i,s,pre):
  return (s*i +pre)%p
 
M = [0]*p
M[0] = 1
t = 1
now = 0
for i in S[::-1]:
    i = int(i)
    now += i*t
    now %= p
    M[now] += 1
    t = t*10%p

ans = sum(map(lambda m:(m*(m-1))//2, M))
print(ans)
### BUGGY CODE ###

import sys, math
from itertools import permutations, combinations
from collections import defaultdict, Counter, deque
from math import factorial
from bisect import bisect_left #bisect_left(list, value)
#from fractions import gcd
sys.setrecursionlimit(10**7)
enu = enumerate
MOD = 10**9+7
def input(): return sys.stdin.readline()[:-1]
def pri(x): print('\n'.join(map(str, x)))

K = int(input())
d = defaultdict(int)

if K<10:
    print(K)
    exit()

# i: 0~99
# j: 0~8
dp = [[0]*10 for _ in range(20)]
for i in range(10):
    dp[0][i] = 1

end = False
# morau DP
i = 1
cnt = 9
while 1:
    #print('i: ', i)
    #pri(dp)
    for j in range(10):
        #print('j: ', j)
        if end:
            break
        if j==0:
            dp[i][j] += dp[i-1][j]
            dp[i][j] += dp[i-1][j+1]
        elif j==9:
            dp[i][j] += dp[i-1][j-1]
            dp[i][j] += dp[i-1][j]
        else:
            dp[i][j] += dp[i-1][j-1]
            dp[i][j] += dp[i-1][j]
            dp[i][j] += dp[i-1][j+1]

        if j!=0:
            addval = dp[i][j]
        else:
            addval = 0

        #print(' i, j, cnt, addval:', i, j, cnt, addval)
        if cnt+addval>=K:
        #if dp[i][j]>=K and j!=0:
            end = True
            break
        else:
            cnt += addval
    if end:
        break
    i += 1

#pri(dp)
#print(i, j, cnt)

def check(i, val): # i+1 桁の数が来る
    sval = str(val)
    for k in range(i):
        aa = abs(int(sval[k])-int(sval[k+1]))
        if aa>1:
            return False
    else:
        return True

val = 10**i*j
while cnt<K:
    #print(' val:', val)
    if check(i, val):
        cnt += 1
    val += 1
        
print(val-1)




### FIXED CODE ###

#import numpy as np
import sys, math
from itertools import permutations, combinations
from collections import defaultdict, Counter, deque
from math import factorial#, gcd
from bisect import bisect_left #bisect_left(list, value)
sys.setrecursionlimit(10**7)
enu = enumerate
MOD = 10**9+7
def input(): return sys.stdin.readline()[:-1]
pl = lambda x: print(*x, sep='\n')

K = int(input())
d = deque()
for i in range(1, 10):
    d.append(i)

def myappend(n):
    sn = str(n)
    nlast = n%10
    if nlast == 0:
        d.append(10*n + nlast)
        d.append(10*n + nlast + 1)
    elif nlast == 9:
        d.append(10*n + nlast - 1)
        d.append(10*n + nlast)
    else:
        d.append(10*n + nlast - 1)
        d.append(10*n + nlast)
        d.append(10*n + nlast + 1)

cnt = 0
while d:
    val = d.popleft()
    cnt += 1
    if cnt == K:
        print(val)
        exit()
    myappend(val)
### BUGGY CODE ###

import bisect
import sys
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
ans = int(0)

N = I()
color = []
a = I()
maxcolor =[]
maxcolor.append(a)
lena = 1
for i in range(N-1):
    a = I()
    minmaxcolor = min(maxcolor)
    if a<=minmaxcolor:
        maxcolor.insert(0,a)
#        maxcolor.append(a)
        lena += 1
    else:
        acandi = bisect.bisect_left(maxcolor, a)
        maxcolor[acandi-1] = a
        """
        aupper = lena-1
        alower = int(0)
        acandi = aupper//2
        
        for _ in range(aupper+1):
            if maxcolor[acandi]>=a:
                alower = acandi
                acandi = (aupper+acandi+1)//2
            else:
                if aupper - alower <= 1:
                    maxcolor[acandi] = a
                    break
                else:
                    aupper = acandi
                    acandi = (acandi + alower) // 2
        """

#print(maxcolor)
ans = len(maxcolor)
print(ans)

### FIXED CODE ###

from collections import deque
import bisect
import sys
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
ans = int(0)

N = I()
color = []
a = I()
maxcolor =deque()
maxcolor.append(a)
lena = 1
for i in range(N-1):
    minmaxcolor = maxcolor[0]
    a = I()
    if a<=minmaxcolor:
        maxcolor.appendleft(a)
#        maxcolor.append(a)
        lena += 1
    else:
        acandi = bisect.bisect_left(maxcolor, a)
        maxcolor[acandi-1] = a
        """
        aupper = lena-1
        alower = int(0)
        acandi = aupper//2
        
        for _ in range(aupper+1):
            if maxcolor[acandi]>=a:
                alower = acandi
                acandi = (aupper+acandi+1)//2
            else:
                if aupper - alower <= 1:
                    maxcolor[acandi] = a
                    break
                else:
                    aupper = acandi
                    acandi = (acandi + alower) // 2
        """

#print(maxcolor)
ans = len(maxcolor)
print(ans)
### BUGGY CODE ###

class Node:
    def __init__(self):
        self.child = [None] * 26
        self.counts = [0] * 26

    # def add(self, s, bucket, idx_s):
    #     c = s[idx_s]
    #     if self.child[c] is None:
    #         self.child[c] = Node()
    #     for i, cnt in enumerate(bucket):
    #         if cnt:
    #             self.counts[i] += 1
    #     bucket[c] -= 1
    #     if idx_s >= 1:
    #         self.child[c].add(s, bucket, idx_s - 1)
    #     else:
    #         Leaves.append(self.counts)

    def add(self, s, bucket):
        node = self
        for idx_s, c in zip(range(len(s)-1, -1, -1), s[::-1]):
            if node.child[c] is None:
                node.child[c] = Node()
            for i, cnt in enumerate(bucket):
                if cnt:
                    node.counts[i] += 1
            bucket[c] -= 1
            if idx_s > 0:
                node = node.child[c]
        Leaves.append(node.counts)

    # def get(self, s, idx_s):
    #     c = s[idx_s]
    #     if idx_s > 0:
    #         return self.child[c].get(s, idx_s-1)
    #     else:
    #         return self.counts[c]

Leaves = []
trie = Node()
N = int(input())
S = [[ord(c)-97 for c in input()] for _ in range(N)]
for s in S:
    b = [0] * 26
    for c in s:
        b[c] += 1
    trie.add(s, b)
ans = -N
# for s in S:
#     ans += trie.get(s, len(s)-1)
for s, l in zip(S, Leaves):
    ans += l[s[0]]
print(ans)


### FIXED CODE ###

class Node:
    def __init__(self):
        self.child = [None] * 26
        self.counts = [0] * 26

    # def add(self, s, bucket, idx_s):
    #     c = s[idx_s]
    #     if self.child[c] is None:
    #         self.child[c] = Node()
    #     for i, cnt in enumerate(bucket):
    #         if cnt:
    #             self.counts[i] += 1
    #     bucket[c] -= 1
    #     if idx_s >= 1:
    #         self.child[c].add(s, bucket, idx_s - 1)
    #     else:
    #         Leaves.append(self.counts)

    def add(self, s, bucket):
        node = self
        for idx_s, c in zip(range(len(s)-1, -1, -1), s[::-1]):
            if node.child[c] is None:
                node.child[c] = Node()
            for i, cnt in enumerate(bucket):
                if cnt:
                    node.counts[i] += 1
            bucket[c] -= 1
            if idx_s > 0:
                node = node.child[c]
        Leaves.append(node.counts)

    # def get(self, s, idx_s):
    #     c = s[idx_s]
    #     if idx_s > 0:
    #         return self.child[c].get(s, idx_s-1)
    #     else:
    #         return self.counts[c]

Leaves = []
trie = Node()
N = int(input())
S = [[ord(c)-97 for c in input()] for _ in range(N)]
for s in S:
    b = [0] * 26
    for c in s:
        b[c] += 1
    trie.add(s, b)
ans = -N
# for s in S:
#     ans += trie.get(s, len(s)-1)
for s, l in zip(S, Leaves):
    ans += l[s[0]]
print(ans)
### BUGGY CODE ###

N = int(input())
A = []
x = [[] for i in range(N)]
y = [[] for i in range(N)]
for i in range(N):
    A.append(int(input()))
    for j in range(A[i]):
        tmpX, tmpY = map(int, input().split())
        x[i].append(tmpX-1)
        y[i].append(tmpY)
ans = 0

for case in range(2**N):
    flag = True
    honest = 0
    for i in range(N):
        for j in range(A[i]):
            if (case >> i)&1 and (case >> x[i][j])&1 != y[i][j]:
                flag = False
        honest += (case >> i)&1

    if flag:
        ans = max(ans, honest)

print(ans)

### FIXED CODE ###

N = int(input())
A = []
x = [[] for i in range(N)]
y = [[] for i in range(N)]
for i in range(N):
    A.append(int(input()))
    for j in range(A[i]):
        tmpX, tmpY = map(int, input().split())
        x[i].append(tmpX-1)
        y[i].append(tmpY)
ans = 0

for case in range(2**N):
    flag = True
    case = str(format(case, '016b'))[-N:]
    honest = [i for i, x in enumerate(case) if x == '1']
    #print(honest)
    for hon in honest:
        for j, other in enumerate(x[hon]):
            #print(other in honest)
            if (other in honest) and (y[hon][j] == 0):
                flag = False

            elif (not(other in honest)) and (y[hon][j] == 1):
                flag = False

            else:
                continue
    #print(flag)
    if flag:
        ans = max(ans, len(honest))

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

N=int(input())
a_l=[int(i) for i in input().split()]

def xor(i,j):
    l=len(str(format(max(i,j),'b')))
    i2=str(format(i,'b').zfill(l))
    j2=str(format(j,'b').zfill(l))
    ans=0
    for k in range(l):
        if i2[k]!=j2[k]:
            ans+=2**(l-k-1)
    return ans

sum1=0
j=1
for i in range(N-1):
    while j<N:
        sum1+=xor(a_l[i],a_l[j])
        j+=1
    j=i+2
print(sum1%(7+10**9))

### FIXED CODE ###

n=int(input())
lis=list(map(lambda x:format(int(x),'b'),input().split()))
l=0
for i in range(n):
    l=max(l,len(lis[i]))

d0=[0]*60
d1=[0]*60

for i in range(n):
    lis[i]=lis[i].zfill(l)
    for j in range(l):
        if lis[i][-j-1]=='0':
            d0[j]+=1
        else:
            d1[j]+=1

ans=0
for i in range(60):
    ans+=(d0[i]*d1[i]*2**i)%(10**9+7)
print(ans%(10**9+7))
### BUGGY CODE ###

N, K = map(int, input().split())
h = list(map(int, input().split()))
 
DP = [0]
for i in range(N-1):
    act = float("inf")
    for k in range(K):
        if i-k < 0 : continue
        act = min(DP[-1-k] + abs(h[i-k]-h[i+1]) , act)
    DP += [act]

print(DP[-1])

### FIXED CODE ###

# -*- coding: utf-8 -*-

import numpy as np

N, K = map(int, input().split())
 
h = np.array(list(map(int, input().split())))
 
dp = np.zeros(N)
 
for n in range(1, N):
    k = min(K, n)
    temp = np.min(dp[n-k:n] + np.abs(h[n]-h[n-k:n]))
    dp[n] = temp
print(int(dp[-1]))
### BUGGY CODE ###

N = int(input())
S = list(input())
S_set = set()
i_set = set()

ans_list = {}


for i in range(N):
    if S[i] in i_set:
        continue
    i_set.add(S[i])
    for j in range(i+1, N):
        if not S[j + 1:N] or S[i] + S[j] in S_set:
            continue
        ans_list[S[i] + S[j]] = S[j + 1:N]
        S_set.add(S[i] + S[j])
count = 0
# print(ans_list)
ans_len_list = [len(set(value)) for value in ans_list.values()]
print(sum(ans_len_list))

### FIXED CODE ###

N = int(input())
S = list(input())
visited = {}

count = 0

for i, s in enumerate(S):
    if s in visited:
        continue
    visited[s] = []
    for j, s2 in enumerate(S[i+1:N-1]):
        # print(s, s2, S[i + j + 2:N])
        if s2 in visited[s]:
            continue
        count += len(set(S[i + j + 2:N]))
        visited[s].append(s2)
        # print(s, s2, set(S[j + 1:N]))
print(count)
### BUGGY CODE ###

# http://drken1215.hatenablog.com/entry/2020/01/12/011700

def combination_builder(max_value, mod):
    fact = [-1] * (max_value + 1)
    fact[0] = 1
    fact[1] = 1
    for x in range(2, max_value + 1):
        fact[x] = x * fact[x - 1] % mod

    invs = [1] * (max_value + 1)
    invs[max_value] = pow(fact[max_value], mod - 2, mod)
    for x in range(max_value - 1, 0, -1):
        invs[x] = invs[x + 1] * (x + 1) % mod

    def _combination(n, r):
        """combination(max_value, all)"""
        nonlocal fact, invs, mod

        if n - r < r: return _combination(n, n - r)
        if r < 0: return 0
        if r == 0: return 1
        if r == 1: return n
        return fact[n] * invs[r] * invs[n - r] % mod

    return _combination


def main():
    MOD = 10 ** 9 + 7

    n, k = map(int, input().split())
    *a, = map(int, input().split())

    cmb = combination_builder(max_value=n, mod=MOD)

    dp = [[0] * (n + 1) for _ in range(k + 1)]
    dp[0][0] = 1

    for i, ai in enumerate(a):
        for counted in range(n + 1):
            for to_count in range(ai + 1):
                if counted + to_count > n:
                    break
                dp[i + 1][counted + to_count] = (
                                                        dp[i + 1][counted + to_count]
                                                        + dp[i][counted]
                                                        * cmb(n - counted, to_count)
                                                        * cmb(n - to_count, ai - to_count)
                                                ) % MOD

    print(dp[k][n])


if __name__ == '__main__':
    main()


### FIXED CODE ###

# http://drken1215.hatenablog.com/entry/2020/01/12/011700

def main():
    MOD = 10 ** 9 + 7

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

    # -+-+-+-prepare combination-+-+-+-
    # -+-+-+-START-+-+-+-
    fact = [0] * (N + 1)
    fact[0] = 1
    fact[1] = 1
    for x in range(2, N + 1):
        fact[x] = x * fact[x - 1] % MOD

    invs = [1] * (N + 1)
    invs[N] = pow(fact[N], MOD - 2, MOD)
    for x in range(N - 1, 0, -1):
        invs[x] = invs[x + 1] * (x + 1) % MOD

    def cmb(n, r):
        if n - r < r: return cmb(n, n - r)
        if r < 0: return 0
        if r == 0: return 1
        if r == 1: return n
        return (((fact[n] * invs[r]) % MOD) * invs[n - r]) % MOD

    # -+-+-+-END-+-+-+-

    dp = [0] * (N + 1)
    dp[0] = 1

    for i, ai in enumerate(a):
        ndp = [0] * (N + 1)
        for counted in range(N + 1):
            for to_count in range(min(N - counted, ai) + 1):
                ndp[counted + to_count] = (
                                                  ndp[counted + to_count]
                                                  + dp[counted]
                                                  * cmb(N - counted, to_count)
                                                  * cmb(N - to_count, ai - to_count)
                                          ) % MOD
        dp = ndp

    print(dp[N])


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

import sys
input = sys.stdin.readline

n,q = map(int,input().split())
imos = []
for i in range(n):
    s,t,x = map(int,input().split())
    if t-x > 0:
        imos.append((max(s-x,0),x))
        imos.append((t-x,-x))
ans = set()
j = 0
l = len(imos)
imos.sort()
for i in range(q):
    d = int(input())
    while j < l:
        now,stop = imos[j]
        if now > d:
            break
        if stop > 0:
            ans.add(stop)
        else:
            ans.remove(-stop)
        j += 1
    if ans:
        print(min(ans))
    else:
        print(-1)


### FIXED CODE ###

import sys
input = sys.stdin.readline

n,q = map(int,input().split())
imos = []
for i in range(n):
    s,t,x = map(int,input().split())
    imos.append((s-x,x))
    imos.append((t-x,-x))
ans = set()
j = 0
for i in range(q):
    d = int(input())
    imos.append((d,1e100))
imos.sort()
m = 1e100
flag = False
for t,stop in imos:
    if stop == 1e100:
        if ans:
            if not flag:
                m = min(ans)
                flag = True
            print(m)
        else:
            print(-1)
    elif stop > 0:
        ans.add(stop)
        if stop < m:
            m = stop
            flag = True
    else:
        ans.remove(-stop)
        if m == -stop:flag = False
### BUGGY CODE ###

#!/usr/bin/env python

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

    ball_dict = {}
    for i in range(n):
        if a[i] in ball_dict.keys():
            ball_dict[a[i]] += 1
        else:
            ball_dict.setdefault(a[i], 1)

    for i in range(n):
        new_dict = ball_dict.copy()
        new_dict[a[i]] -= 1
        ans = 0
        for v in new_dict.values():
            ans += v * (v - 1) // 2
        print(ans)

if __name__ == '__main__':
    main()


### FIXED CODE ###

#!/usr/bin/env python

def main():
    n = int(input())
    a = list(map(int, input().split()))
    a_sort = sorted(a)

    ball_dict = {}
    count = 1
    for i in range(1, n):
        if a_sort[i] == a_sort[i - 1]:
            count += 1
        else:
            ball_dict.setdefault(a_sort[i - 1], count)
            count = 1
    ball_dict.setdefault(a_sort[n - 1], count)

    ans = 0
    for v in ball_dict.values():
        ans += v * (v - 1) // 2

    ans_dict = {}
    for v in ball_dict.values():
        if v not in ans_dict:
            ans_dict.setdefault(v, ans - (v - 1))

    for i in range(n):
        print(ans_dict[ball_dict[a[i]]])

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

from itertools import product

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

# print(len(list(filter(lambda x: 2*x%K==0, range(1, N+1))))**2)
l = []
for i in range(1, N+1):
	if (2*i)%K == 0:
		l.append(i)
count = 0
for a, b, c in product(l, repeat=3):
	if (a+b)%K == (b+c)%K == (c+a)%K == 0:
		count += 1
print(count)

### FIXED CODE ###

from itertools import product

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

"""
i%K == 0 ならその数同士で条件に合う数列を作れる
i%K == K//2 ならその数同士で条件に合う数列を作れる(Kが偶数の場合)
これらは条件によって導ける
"""

count = (N//K)**3
if K%2 == 0:
	count += (N//K + (N%K >= K//2))**3
print(count)
### BUGGY CODE ###

import bisect
import math

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

a.sort()

n1 = math.ceil(math.log(1000000000,2))+1

s = [0 for _ in range(n)]
s[0] = a[0]
for i in range(1,n) :
  s[i] = s[i-1]+a[i]

ans = 0
for i in range(n) :
  h = 0
  m = a[i]*2
  for j in range(n1) :
    mg = bisect.bisect_left(a,m)
    if mg <= n-1 and m == a[mg] :
      mg += 1
    m = s[mg-1]*2
    if m >= a[n-1] :
      ans += 1
      break
  
print(ans)

### FIXED CODE ###

import bisect
import math

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

a.sort()

n1 = math.ceil(math.log(1000000000,2))+1

s = [0 for _ in range(n)]
s[0] = a[0]
for i in range(1,n) :
  s[i] = s[i-1]+a[i]

ans = 0
for i in range(n) :
  h = 0
  m = a[i]*2
  for j in range(n1) :
    mg = bisect.bisect_left(a,m)
    if mg <= n-1 and m == a[mg] :
      mg += 1
    m = s[mg-1]*2
    if m >= a[n-1] :
      ans += 1
      break
  
print(ans)
### BUGGY CODE ###

N = int(input())
L = list(map(int, input().split()))
ans = 0
for i in range(N):
  for j in range(i + 1, N):
    for k in range(j + 1, N):
      #print(str(i) + str(j) + str(k))
      if L[i] < L[j] + L[k] and L[j] < L[k] + L[i] and L[k] < L[i] + L[j]:
        ans += 1
print(ans)

### FIXED CODE ###

import bisect
N = int(input())
#ソートしておく
L = sorted(list(map(int, input().split())))
ans = 0

#短い2辺を総当たりで選択
for i in range(N - 2):
  for j in range(i + 1, N - 1):
    #小さい順に並べた時の成立条件
    # l1 + l2 > l3
    l12 = L[i] + L[j]
    #l2の隣から　l12以下のところまで全部が対象、成立しない場合
    #ans += max(bisect.bisect_left(L, l12) - j - 1, 0)
    ans += bisect.bisect_left(L, l12) - j - 1
print(ans)
### BUGGY CODE ###

#n=int(input())
n,k=map(int,input().split())
al=list(map(int,input().split()))
#l=[list(map(int,input().split())) for i in range(n)]
def f(l):
    res=1
    for li in l:
        res=res*li
    return res
sc=[]
for i in range(k-1,n):
    score=f(al[i-k+1:i+1])
    sc.append(score)
for i in range(n-k):
    if sc[i+1]>sc[i]:
        print('Yes')
    else:
        print('No')

### FIXED CODE ###

#n=int(input())
n,k=map(int,input().split())
al=list(map(int,input().split()))
#l=[list(map(int,input().split())) for i in range(n)]
def f(l):
    res=1
    for li in l:
        res=res*li
    return res
sc=[]
alr=0
for i in range(k-1,n):
    if i==k-1:
        #score=f(al[i-k+1:i+1])
        first=al[i-k+1]
        alr=1
    else:
        #first=al[i-k]
        last=al[i]
        if last>first :
            print('Yes')
        else:
            print('No')
        first=al[i-k+1]