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

import bisect, collections, copy, heapq, itertools, math, string
import sys
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int, sys.stdin.readline().rstrip().split())
def LI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())

def main():
    import bisect
    def partition(A, p, r):
        x = A[r]
        i = p - 1
        for j in range(p, r):
            if A[j] <= x:
                i += 1
                a = A[i]
                b = A[j]
                A[i] = b
                A[j] = a
        c = A[i + 1]
        A[i + 1] = x
        A[r] = c
        return i + 1
    N, M, K = map(int, input().split())
    A = list(map(int, input().split()))
    B = list(map(int, input().split()))
    time = 0
    cnt = 0
    C = []
    SA = [0]
    SB = [0]
    for a in A:
        SA.append(SA[-1] + a)
    for b in B:
        SB.append(SB[-1] + b)
    for x in range(N + 1):
        L = K - SA[x]
        if L < 0:
            break
        SB.append(L)
        y_max = partition(SB, 0, len(SB) - 1) - 1
        SB.remove(L)
        C.append(y_max + x)
    print(max(C))


if __name__ == "__main__":
    main()

### 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 j in range(M):
    b.append(b[j] + B[j])
j = M
ans = []
for i in range(N + 1):
    if a[i] > K:
        break
    while b[j] > K - a[i]:
        j -= 1
    ans.append(i + j)
ans_max = max(ans)
print(ans_max)
### BUGGY CODE ###

import sys
from collections import defaultdict
N = int(input())
if N <= 3:
    print(0)
    sys.exit()
s = input()
ls = [defaultdict(int) for i in range(N)]
a = ['R', 'G', 'B']
for i, x in enumerate(s):
    for y in a:
        if x == y:
            ls[i][y] = ls[max(0, i-1)][y] + 1
        else:
            ls[i][y] = ls[max(0, i-1)][y]
ans = 0
for i in range(N-2):
    for j in range(i+1, N-1):
        if s[i] != s[j]:
            for k in a:
                if k != s[i] and k != s[j]:
                    ans += ls[-1][k] - ls[j][k]
            if 2*j-i <N and s[i] != s[2*j-i] and s[j] != s[2*j-i]:
                ans -= 1
print(ans)

### FIXED CODE ###

import sys
from collections import defaultdict
N = int(input())
if N <= 3:
    print(0)
    sys.exit()
s = input()
ls = [defaultdict(int) for i in range(N)]
a = ['R', 'G', 'B']
for i, x in enumerate(s):
    for y in a:
        if x == y:
            ls[i][y] = ls[max(0, i-1)][y] + 1
        else:
            ls[i][y] = ls[max(0, i-1)][y]
ans = 0
for i in range(N-2):
    for j in range(i+1, N-1):
        if s[i] != s[j]:
            for k in a:
                if k != s[i] and k != s[j]:
                    ans += ls[-1][k] - ls[j][k]
            if 2*j-i <N and s[i] != s[2*j-i] and s[j] != s[2*j-i]:
                ans -= 1
print(ans)
### BUGGY CODE ###

from numpy.linalg import solve
N = int(input())
A = list(map(int, input().split()))

left = [[0 for _ in range(N)] for _ in range(N)]
right = []
for i in range(N):
  right.append(2 * A[i] + 2 * A[(i + 1) % N])
  for j in range(N):
    if j == i or j == (i + 2) % N:
      left[i][j] = 1
    if j == (i + 1) % N:
      left[i][j] = 2

ans = solve(left, right)
for i in range(N):
  print(int(round(ans[i])), end = "")
  if i == N - 1:
    print()
  else:
    print(" ", end = "")

### FIXED CODE ###

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

ans = 0
for i in range(N):
  tmp = ans
  if i == 0:
    for j in range(N):
      if j % 2 == 0:
        ans += A[j]
      else:
        ans -= A[j]
  else:
    ans = 2 * A[i - 1] - tmp

  tmp = ans
  print(ans, end = "")
  if i != N - 1:
    print(" ", end = "")
  else:
    print()
### BUGGY CODE ###

def main():
    N = int(input())
    A = [int(input()) for _ in range(N)]
    A.sort()
    ans = 0
    edge = [A.pop()] * 2
    while len(A):
        a = abs(edge[0] - A[0])
        b = abs(edge[0] - A[len(A) - 1])
        c = abs(edge[1] - A[0])
        d = abs(edge[1] - A[len(A) - 1])
        if max(a, b, c, d) == a:
            edge[0] = A.pop(0)
            ans += a
        elif max(a, b, c, d) == b:
            edge[0] = A.pop()
            ans += b
        elif max(a, b, c, d) == c:
            edge[1] = A.pop(0)
            ans += c
        else:
            edge[1] = A.pop()
            ans += d
    print(ans)


if __name__ == "__main__":
    main()


### FIXED CODE ###

from collections import deque


def main():
    N = int(input())
    A = [int(input()) for _ in range(N)]
    A.sort()
    ans = 0
    B = deque(A)
    edge = [B.popleft()] * 2
    while len(B):
        a = abs(edge[0] - B[0])
        b = abs(edge[0] - B[len(B) - 1])
        c = abs(edge[1] - B[0])
        d = abs(edge[1] - B[len(B) - 1])
        if max(a, b, c, d) == a:
            edge[0] = B.popleft()
            ans += a
        elif max(a, b, c, d) == b:
            edge[0] = B.pop()
            ans += b
        elif max(a, b, c, d) == c:
            edge[1] = B.popleft()
            ans += c
        else:
            edge[1] = B.pop()
            ans += d
    print(ans)


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

k, s  = map(int, input().split())
ans = 0
for i in range(k + 1):
    for j in range(k + 1):
        for l in range(k + 1):
            if i + j + l == s:
                ans += 1
print(ans)

### FIXED CODE ###

k, s  = map(int, input().split())
ans = 0
for i in range(k + 1):
    for j in range(i, k + 1):
        if j <= s - i - j <= k:
            l = s - i - j
            if i == j == l:
                ans += 1
            elif i == j or j == l:
                ans += 3
            elif i != j != l:
                ans += 6
print(ans)
### BUGGY CODE ###

s = input()
x, y = map(int, input().split())
n = len(s)
#dp_x: +, -に向いてて行けるかどうか
dp_x = [[False, False] for i in range(2*n+2)]
dp_y = [[False, False] for i in range(2*n+2)]
dp_x[0][0] = True
dp_y[0][0] = True
dp_y[0][1] = True

flag = 0
for i in range(len(s)):
    if s[i] == "T":
        if flag == 0:
            flag = 2
            for j in range(-n, n+1):
                if dp_x[j][0]:
                    dp_x[j][1] = True

        elif flag == 2:
            flag = 1
            for j in range(-n, n+1):
                dp_x[j][0] = dp_x[j][1] or dp_x[j][0]
                dp_x[j][1] = dp_x[j][1] or dp_x[j][0]

        else:
            flag = 2
            for j in range(-n, n+1):
                dp_y[j][0] = dp_y[j][1] or dp_y[j][0]
                dp_y[j][1] = dp_y[j][1] or dp_y[j][0]


    else:
        if flag == 0:
            for j in range(n, -n-1, -1):
                dp_x[j][0] = dp_x[j-1][0]

        elif flag == 1:
            for j in range(n, -n-1, -1):
                dp_x[j][0] = dp_x[j-1][0]
                dp_x[-j][1] = dp_x[-j+1][1]
        else:
            for j in range(n, -n-1, -1):
                dp_y[j][0] = dp_y[j-1][0]
                dp_y[-j][1] = dp_y[-j+1][1]


if dp_x[x][0] or dp_x[x][1]:
    if dp_y[y][0] or dp_y[y][1]:
        print("Yes")
    else:
        print("No")
else:
    print("No")


### FIXED CODE ###

s = input()
x, y = map(int, input().split())
n = len(s)
#dp_x: +, -に向いてて行けるかどうか
dp_x = [[False, False] for i in range(2*n+2)]
dp_y = [[False, False] for i in range(2*n+2)]
dp_x[0][0] = True
dp_y[0][0] = True
dp_y[0][1] = True

flag = 0
for i in range(len(s)):
    if s[i] == "T":
        if flag == 0:
            flag = 2
            for j in range(-i-1, i+2):
                if dp_x[j][0]:
                    dp_x[j][1] = True

        elif flag == 2:
            flag = 1
            for j in range(-i-1, i+2):
                dp_x[j][0] = dp_x[j][1] or dp_x[j][0]
                dp_x[j][1] = dp_x[j][1] or dp_x[j][0]

        else:
            flag = 2
            for j in range(-i-1, i+2):
                dp_y[j][0] = dp_y[j][1] or dp_y[j][0]
                dp_y[j][1] = dp_y[j][1] or dp_y[j][0]


    else:
        if flag == 0:
            for j in range(i+1, -i-2, -1):
                dp_x[j][0] = dp_x[j-1][0]

        elif flag == 1:
            for j in range(i+1, -i-2, -1):
                dp_x[j][0] = dp_x[j-1][0]
                dp_x[-j][1] = dp_x[-j+1][1]
        else:
            for j in range(i+1, -i-2, -1):
                dp_y[j][0] = dp_y[j-1][0]
                dp_y[-j][1] = dp_y[-j+1][1]


if dp_x[x][0] or dp_x[x][1]:
    if dp_y[y][0] or dp_y[y][1]:
        print("Yes")
    else:
        print("No")
else:
    print("No")
### BUGGY CODE ###

import math

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

A.sort()

max_cmb = 0
m = A[-1]
r = 0
for a in A[: -1]:
    cmb = math.factorial(m) // (math.factorial(m - a) * math.factorial(a))
    if max_cmb < cmb:
        max_cmb = cmb
        r = a

print(m, r)

### FIXED CODE ###

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

A.sort()

m = A[-1]
M = [abs((m / 2) - a) for a in A[: -1]]
r = A[M.index(min(M))]

print(m, r)
### BUGGY CODE ###

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

mod = 10 ** 9 + 7
sum = 0

for i in range(n):
    for j in range(i + 1, n):
        sum += a[i] * a[j]
        sum %= mod

print(sum)

### FIXED CODE ###

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

mod = 10 ** 9 + 7
s = sum(a)
sum = 0

for i in range(n):
    s -= a[i]
    sum += s * a[i] % mod

sum %= mod
print(sum)
### BUGGY CODE ###

N, K = map(int, input().split())
A = list(map(int, input().split()))
A = A + [0]

if K >= N - 1:
    ans = [N] * N
    print(*ans)

else:
    for i in range(K):
        tmp = [0] * (N + 1)
        for j in range(N):
            
            end_l = max(j - A[j], 0)
            end_r = min(j + A[j] + 1, N)
            tmp[end_l] += 1
            tmp[end_r] -= 1

        for j in range(1, N):
            tmp[j] += tmp[j - 1]
            A[j] = tmp[j]
        A[0] = tmp[0]

    print(*A[:N])

### FIXED CODE ###

N, K = map(int, input().split())
A = list(map(int, input().split()))
A = A + [0]

if K >= N - 1:
    ans = [N] * N
    print(*ans)

else:
    for i in range(K):
        tmp = [0] * (N + 1)
        
        for j in range(N):
            end_l = max(j - A[j], 0)
            end_r = min(j + A[j] + 1, N)
            
            tmp[end_l] += 1
            tmp[end_r] -= 1
        
        flg = tmp[0]
        
        for j in range(1, N):
            tmp[j] += tmp[j - 1]
            flg += tmp[0]
            A[j] = tmp[j]
        
        A[0] = tmp[0]
        
        if flg == N**2:
            break
            
    print(*A[:N])
### BUGGY CODE ###

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


def digit(i):
    if i>0:
        return digit(i//10)+[i%10]
    else:
        return []

def Sooo(N):
    return float(N/sum(digit(N)))
base=1
A=[]         
for i in range(0,20):
    for j in range(1,136):
        re=base*(j+1)-1
        A.append(int(re))
    base = base*10
A = list(set(A))
A.sort()

for i in range(0,len(A)):
    for j in range(i+1,len(A)):
        N=Sooo(A[i])
        M=Sooo(A[j])
        if N>M:
            A[i]=1

A = list(set(A))
A.sort()

K=int(input())
for i in range(K):
    print(A[i])

### FIXED CODE ###

#!/usr/bin/env python
# -*- coding:utf-8 -*- 
S = list(input())
Ans=0
for i in S:
    if i=="+":
        Ans = Ans+1
    else:
        Ans = Ans-1
print(Ans)
### BUGGY CODE ###

s = str(input())
q = int(input())
actions = []

for i in range(q):
  actions.append(input().split(" "))

for action in actions:
  if action[0] == "1":
    s = s[::-1]
  else:
    if action[1] == "1":
      s = action[2]+s
    else:
      s = s+action[2]
    
print(s)

### FIXED CODE ###

s = input()
q = int(input())
results_forward = str("")
results_back = str("")
qlist = []
for i in range(q):
  qlist.extend(input().split(" "))

amount = 0
for i in range(len(qlist)):
  if qlist[i] == "1" or qlist[i] == "2":
    amount += int(qlist[i])
  elif amount%2 == 1:
    results_forward = qlist[i] + results_forward
    amount -= int(qlist[i-1])
  elif amount%2 == 0:
    results_back = results_back + qlist[i]
    amount -= int(qlist[i-1])

if q%2 == (len(results_forward)+len(results_back))%2:
  print(results_forward+s+results_back)
else:
  print((results_forward+s+results_back)[::-1])
### BUGGY CODE ###

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

# DP
INF = int(1e10)
dp = [INF] * N
dp[0] = 0

for i in range(N-1):
    for j in range(K+1):
        if j == 0:
            continue
        if i+j >= N:
            break
        else:
            dp[i+j] = min(dp[i+j], dp[i] + abs(h[i+j] - h[i]))

print(dp[N-1])

### FIXED CODE ###

# Educational DP Contest B-Frog 2

def frog(N, K, h):
    # initialize
    inf = float('inf')
    dp = [inf] * N
    
    minKN = min(K, N)
    for i in range(minKN):
        if i == 0:
            dp[i] = 0
        else: 
            dp[i] = abs(h[0] - h[i])
            for j in range(minKN):
                if j == i:
                    continue
                elif j < i:
                    dp[i] = min(dp[i], dp[j] + abs(h[i] - h[j]))
    # DP
    for i in range(N):
        if i == 0:
            continue
        elif i < K:
            continue
        else:
            dp[i] = min([abs(h[k] - h[i]) + dp[k] for k in range(i-K, i)])
    return dp[N-1]
    
if __name__ == "__main__":
    N, K = map(int, input().split())
    h = list(map(int, input().split()))
    print(frog(N, K, h))
### BUGGY CODE ###

S = input()
K = int(input())
store = []
for i in range(len(S)):
  N = i+1
  while N <= len(S):
    store.append(S[i:N])
    N += 1
store_set = set(store)
store_list = list(store_set)

List = [ x for x in store_list  if len(x) <= K ]
List.sort()
print(List[K-1])
  

### FIXED CODE ###

S = input()
K = int(input())
store = []
for i in range(len(S)):
  N = i+1
  while N <= i + 5:
    store.append(S[i:N])
    N += 1
store_set = set(store)
store_list = list(store_set)

List = [ x for x in store_list  if len(x) <= K ]
List.sort()
print(List[K-1])
### BUGGY CODE ###

N, Q = map(int, input().split())
link = [[0]*(N+1) for _ in range(N+1)]
for n in range(N-1):
    a, b = map(int, input().split())
    link[a][b] = 1
    link[b][a] = 1
V = [0] * (N+1)
ans = [0] * (N+1)
for q in range(Q):
    p, x = map(int, input().split())
    V[p] += x

def dfs(i, parent, acc):
    V[i] += acc
    for j in range(N+1):
        if link[i][j] == 1 and parent!=j:
            dfs(j,i,V[i])
acc = 0
dfs(1,0,acc)
V = [str(v) for v in V]
print (" ".join(V[1:]))

### FIXED CODE ###

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

# 遅延評価で加えてあげるだけ

N,Q = map(int,input().split())
AB = [[int(x) for x in input().split()] for _ in range(N-1)]
PX = [[int(x) for x in input().split()] for _ in range(Q)]

graph = [[] for _ in range(N+1)]
for a,b in AB:
    graph[a].append(b)
    graph[b].append(a)

value = [0] * (N+1)
for p,x in PX:
    value[p] += x

def dfs(v,parent,add):
    value[v] += add
    for x in graph[v]:
        if x == parent:
            continue
        dfs(x,v,value[v])

dfs(1,0,0)

answer = ' '.join(map(str,value[1:]))
print(answer)
### BUGGY CODE ###

K = int(input())

# from fractions import gcd
from math import gcd

def f(x, y, z):
    r = gcd(gcd(x, y), z)
    return r



ans = 0
for i in range(1, K+1):
    for j in range(1, K+1):
        for k in range(1, K+1):
            ans += f(i, j, k)

print(ans)

### FIXED CODE ###

K = int(input())

from fractions import gcd
# return gcd(x, y)

d = {}

def f(x, y, z):
    # print(d)
    if d.get((x,y)):
        s = d[(x,y)]
    else:
        s = gcd(x, y)
        d[(x,y)] = s

    if d.get((s,z)):
        t = d[(s,z)]
    else:
        t = gcd(s,z)
        d[(s,z)] = t

    return t

ans = 0
for i in range(1, K+1):
    for j in range(i, K+1):
        for k in range(j, K+1):
            if i == j == k:
                ans += f(i, j, k)
            elif i == j or j == k:
                ans += 3 * f(i, j, k)
            else:
                ans += 6 * f(i, j, k)

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

import sys


def prepare(n, MOD):
    f = 1
    factorials = [1]
    for m in range(1, n + 1):
        f *= m
        f %= MOD
        factorials.append(f)
    inv = pow(f, MOD - 2, MOD)
    invs = [1] * (n + 1)
    invs[n] = inv
    for m in range(n, 1, -1):
        inv *= m
        inv %= MOD
        invs[m - 1] = inv

    return factorials, invs


n = int(input())
xxx = list(map(int, input().split()))
MOD = 10 ** 9 + 7
factorials, invs = prepare(n, MOD)

# print(factorials)
# print(invs)

ans = 0
dp = [0]
for i in range(n - 1):
    y = xxx[i + 1] - xxx[i]
    tmp = 0
    for k in range(i + 1):
        # print(' ', k, (dp[k] + factorials[k]) * invs[k])
        tmp = (tmp + (dp[k] + factorials[k]) * invs[k]) % MOD
    tmp = tmp * factorials[i] % MOD
    dp.append(tmp)
    # print(dp)
    ans = (ans + y * tmp * invs[i + 1]) % MOD
    # print(i, y, tmp, tmp * invs[i + 1] * factorials[n - 1] % MOD)
ans = ans * factorials[n - 1] % MOD
print(ans)


### FIXED CODE ###

import sys


def prepare(n, MOD):
    f = 1
    factorials = [1]
    for m in range(1, n + 1):
        f *= m
        f %= MOD
        factorials.append(f)
    inv = pow(f, MOD - 2, MOD)
    invs = [1] * (n + 1)
    invs[n] = inv
    for m in range(n, 1, -1):
        inv *= m
        inv %= MOD
        invs[m - 1] = inv

    return factorials, invs


n = int(input())
xxx = list(map(int, input().split()))
MOD = 10 ** 9 + 7
factorials, invs = prepare(n, MOD)

ans = 0
dp = 1
for i in range(n - 1):
    cur = dp * factorials[i] % MOD
    ans = (ans + (xxx[i + 1] - xxx[i]) * cur * invs[i + 1]) % MOD
    dp = (dp + (cur + factorials[i + 1]) * invs[i + 1]) % MOD
ans = ans * factorials[n - 1] % MOD
print(ans)
### BUGGY CODE ###

import itertools

def main():
  n = int(raw_input())
  parts = map(int, raw_input().split())
  result = 0
  conditions = [
    lambda a,b,c: a<b+c,
    lambda a,b,c: b<c+a,
    lambda a,b,c: c<a+b,
  ]
  for comb in itertools.combinations(parts, 3):
    if all([func(*comb) for func in conditions]):
      result += 1
  print(result)

main()

### FIXED CODE ###

def main():
  n = int(raw_input())
  sticks = list(sorted(map(int, raw_input().split())))
  result = 0

  for x in xrange(n):
      z = x + 2
      for y in xrange(x+1, n):
          while (z < n and sticks[x] + sticks[y] > sticks[z]):
              z += 1
          result += z - y -1
  print(result)

main()
### BUGGY CODE ###

n = int(input())
a =[int(x) for x in input().split()]
ans = 0
ans2 = 0
b = 10**9 + 7
for index,i in enumerate(a):
    for j in a[index+1:]:
        ans =  (ans + ((i%b) * j))%b
print(ans)

### FIXED CODE ###

n = int(input())
a_list =[int(x) for x in input().split()]
mod = 10**9 + 7

s_list = [0]*(n+1)
for i,a in enumerate(a_list):
    s_list[i+1] = s_list[i]+a


ans = 0
for i,a in enumerate(a_list):
    ans += a * (s_list[n]-s_list[i+1])
    
print(ans%mod)
### BUGGY CODE ###

import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def divisors(n):
    # 約数列挙

    divisors = []

    for i in range(1, int(n ** 0.5) + 1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n // i)

    return set(divisors)


def main():
    n = int(readline())
    a = list(map(int, readline().split()))
    divs = list(map(lambda x: divisors(x), a))

    ok = [True] * n
    nums = set()
    for i, x in enumerate(a):
        if divs[i] & nums:
            ok[i] = False
        nums.add(x)

    nums = set()
    for j, x in enumerate(a[::-1]):
        i = n - (j + 1)
        if divs[i] & nums:
            ok[i] = False
        nums.add(x)
    print(ok.count(True))


if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def divisors(n):
    # 約数列挙

    divisors = []

    for i in range(1, int(n ** 0.5) + 1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n // i)

    return set(divisors)


def main():
    from collections import Counter

    n = int(readline())
    a = list(map(int, readline().split()))
    counter = Counter(a)
    a.sort()
    mx = max(a)

    ok = [True] * (mx + 1)

    for x in a:
        for y in range(2 * x, mx + 1, x):
            ok[y] = False

    ans = 0
    prev = -1
    for key, val in counter.items():
        if val > 1:
            pass
        else:
            if ok[key]:
                ans += 1

    print(ans)


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

if __name__ == '__main__':
    N = int(input())
    L = sorted(list(map(int, input().split())))
    res = 0
    for i, li in enumerate(L[:-2]):
        for j, lj in enumerate(L[i+1:-1]):
            res_k = 0
            for k, lk in enumerate(L[i+j+2+res_k:]):
                if lk-lj >= li:
                    res_k += k
                    break
            else:
                res += k + 1
            res += res_k
    print(res)


### FIXED CODE ###

import bisect


if __name__ == '__main__':
    N = int(input())
    L = sorted(list(map(int, input().split())))
    ans = 0
    for i in range(N-2):
        for j in range(i+1, N-1):
            ans += bisect.bisect_left(L, L[i]+L[j])-j-1
    print(ans)
### BUGGY CODE ###

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

for i in range(1, n+1):
  ans.append(a.index(i)+1)

print(*ans)

### FIXED CODE ###

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

for i in range(n):
  b[a[i]-1] = i+1
print(*b)
### BUGGY CODE ###

# -*- coding: utf-8 -*-
import sys
import math
from bisect import bisect_left
from bisect import bisect_right
from collections import defaultdict
from heapq import heappop, heappush
import itertools
import random
from collections import deque
from decimal import *
import queue

input = sys.stdin.readline

def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))
def inputStr(): return input()[:-1]

inf = float('inf')
mod = 1000000007

#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-

def main():
	N,K = inputMap()
	A = inputList()

	ans = 1
	ans_old = 1
	mae = 0
	for i,val in enumerate(A):
		if i < K:
			ans_old *= val
			continue

		mae = A[i-K]
		ans = ans_old
		ans = ans / mae * val
		if ans > ans_old:
			print("Yes")
		else:
			print("No")
		ans_old = ans


#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
if __name__ == "__main__":
	main()


### FIXED CODE ###

# -*- coding: utf-8 -*-
import sys
import math
from bisect import bisect_left
from bisect import bisect_right
from collections import defaultdict
from heapq import heappop, heappush
import itertools
import random
from collections import deque
from decimal import *
import queue

input = sys.stdin.readline

def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))
def inputStr(): return input()[:-1]

inf = float('inf')
mod = 1000000007

#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-

def main():
	N,K = inputMap()
	A = inputList()

	ans = 1
	ans_old = 1
	mae = 0
	for i,val in enumerate(A):
		if i < K:
			continue
		tmp = A[i-K]
		if val > tmp:
			print("Yes")
		else:
			print("No")



#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
if __name__ == "__main__":
	main()