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

def gauss_jordan(A, is_extended):
    """掃き出し法でジョルダン標準形を求める"""
    cnt_col = len(A[0])
    cnt_row = len(A)

    #for row in range(cnt_row):
    #    for col in range(cnt_col):
    #        A[row][col] = A[row][col] % MOD

    rank = 0
    for col in range(cnt_col):
        #  拡大係数行列の場合は最後の行は掃き出ししない
        if is_extended and col == cnt_col - 1:
            break

        # ピボットを探す
        pivot = -1
        for row in range(rank, cnt_row):
            if A[row][col]:
                pivot = row
                break

        #  ピボットがない場合は次の列に
        if pivot == -1:
            continue

        # 行をスワップする
        A[pivot], A[rank] = A[rank], A[pivot]

        # ピボットのある列の値がすべて0になるように掃き出す
        for row in range(cnt_row):
            if row != rank and A[row][col]:
                for col2 in range(cnt_col):
                      A[row][col2] ^= A[rank][col2]
        rank += 1

    return A


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

# 全てのxorを計算
# 全てのaを2進数に変換
max_a = max(a)
max_a = bin(max_a)[2::]
xor_sum = 0
for i in range(n):
    xor_sum ^= a[i]

xor_sum = bin(xor_sum)[2::].zfill(len(max_a))
for i in range(n):
    a[i] = bin(a[i])[2::].zfill(len(max_a))

# 行列を作る
# 興味深くないビットについては予めansに答えを足しておく
matrix = [[0] * len(max_a) for _ in range(n)]
ans = 0
for i in range(len(max_a)):
    if xor_sum[i] == "1":
        ans += 2 ** (len(max_a) - i - 1)
    else:
        for j in range(n):
            matrix[j][i] = int(a[j][i])

# ジョルダン標準形を求める
matrix = gauss_jordan(matrix, False)

# xorを取る
tmp = 0
for i in range(n):
    tmp ^= int("".join(map(str, matrix[i])), 2)

# tmpは赤玉、青玉ともに値を持つので2倍して足す
ans = ans + 2*tmp

print(ans)

### FIXED CODE ###

def xor_gauss_jordan(A):
    """掃き出し法でジョルダン標準形を求める"""
    cnt_row = len(A)
    cnt_col = len(bin(max(A))[2::])

    rank = 0
    for col in range(cnt_col):
        # ピボットを探す
        pivot = -1
        for row in range(rank, cnt_row):
            if A[row] & 2**(cnt_col - col - 1):
                pivot = row
                break

        #  ピボットがない場合は次の列に
        if pivot == -1:
            continue

        # 行をスワップする
        A[pivot], A[rank] = A[rank], A[pivot]

        # ピボットのある列の値がすべて0になるように掃き出す
        A_rank = A[rank]
        for row in range(cnt_row):
            if row != rank and A[row] & 2**(cnt_col - col - 1):
                A[row] ^= A[rank]
        rank += 1

    return A


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

# 全てのxorを計算

# 全てのaを2進数に変換
max_a = max(a)
max_a = bin(max_a)[2::]
len_max_a = len(max_a)

# 全てのxorを計算
# xor_sumが1のビットは興味深くない
# 興味深くないビットについては予めansに答えを足して、ビットを0にしておく
ans = 0
xor_sum = 0
for i in range(n):
    xor_sum ^= a[i]
for i in range(len_max_a):
    mask = 2**i
    tmp = mask & xor_sum
    if tmp:
        ans += tmp
        for i in range(n):
            a[i] -= tmp & a[i]

# ジョルダン標準形
a = xor_gauss_jordan(a)

tmp = 0
for i in range(n):
    tmp ^= a[i]
print(ans + 2*tmp)
### BUGGY CODE ###

import sys
input = sys.stdin.readline
N, M = map(int, input().split())
res = []
x = 1
vis = [0] * (N + 1)
while len(res) < M:
  if vis[x] or vis[((x + len(res)) % N) + 1]: x = (x % N) + 1
  else:
    vis[x] = 1
    vis[((x + len(res)) % N) + 1] = 1
    res.append((x, ((x + len(res)) % N) + 1))
    x = (x % N) + 1
  #print(x, res, vis)
for r in res: print(*r)

### FIXED CODE ###

import sys
sys.setrecursionlimit(10 ** 6)
input = sys.stdin.readline
N, M = map(int, input().split())
res = []

def solve(l, r):
  global res
  if r <= l: return
  res.append((l, r))
  solve(l + 1, r - 1)


solve(1, M + 1)
solve(M + 2, M * 2 + 1)
for r in res: print(*r)
### BUGGY CODE ###

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

sum_max = 0

for i in range(K):
    if A:
        sum_max += 1
        A -= 1
    elif B:
        B -= 1
    else:
        sum_max -= 1
        C -= 1

print(sum_max)

### FIXED CODE ###

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

sum=0

if A>K:
    sum += K
    K = 0
else:
    sum += A
    K = K-A

if B>K:
    K = 0
else:
    K = K-B

if C>K:
    sum -= K
    K = 0
else:
    sum -= C
    K = K-C

print(sum)
### BUGGY CODE ###

import numpy as np

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

A = np.ones(N)
B = np.ones(N)

for i in range(N):
    A[i],B[i] = [int(i) for i in input().split()]
    
count=0
price=0
for i in range(N):
    if count>=M:
        break
    min_pr = min(A)
    min_num = np.where(A==min_pr)
    min_num_count = 0
    for i in min_num[0]:
        min_num_count +=B[i]
    A = np.delete(A,min_num[0])
    B = np.delete(B,min_num[0])
    if (count+min_num_count) <=M:
        price+=min_num_count*min_pr
        count+=min_num_count
    elif (count+min_num_count) >M:
        price += (M-count)*min_pr
        count+=min_num_count

        
print(int(price))

### FIXED CODE ###

import numpy as np

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

AB = np.ones([N,2])


for i in range(N):
    AB[i,0],AB[i,1] = [int(i) for i in input().split()]
    
count=0
price=0

AB_new = AB[np.argsort(AB[:,0])]

for i in range(N):

    if count<=M: 
        count+=AB_new[i,1]
        if count<=M:
            price+=AB_new[i,0]*AB_new[i,1]
        elif count>M:
            price+=AB_new[i,0]*(M-count+AB_new[i,1])
    else:
        break

        
print(int(price))
### BUGGY CODE ###

N , Q = map(int, input().split())
S = input()
LR = [[int(i) for i in input().split()] for j in range(Q)]
T = list(S)

for i in LR:
    ct = 0
    for k in range(i[0]-1, i[1]-1):
        if T[k] == "A" and T[k+1] == "C":
            ct += 1
    else:
        print(ct)



### FIXED CODE ###

N , Q = map(int, input().split())
S = input()
LR = [[int(i)-1 for i in input().split()] for j in range(Q)]
T = list(S)
ACtimes = [0] * len(T)

for i in range(1,len(T)):
    if T[i-1] == "A" and T[i] == "C":
        ACtimes[i] = ACtimes[i-1] + 1
    else:
        ACtimes[i] = ACtimes[i-1]

for k in LR:
    print(ACtimes[k[1]] - ACtimes[k[0]])
### BUGGY CODE ###

# import numpy as np
# import math
# import copy
# from collections import deque
import sys
input = sys.stdin.readline
# sys.setrecursionlimit(10000)


def main():
    S = input().rstrip()

    N = len(S)
    S = int(S)

    M = [0 for i in range(2019)]
    M[0] += 1

    for i in range(N):
        T = S % 10 ** (N-i)
        M[T%2019] += 1

    res = 0

    for m in M:
        res += m * (m-1) // 2


    print(res)



main()


### FIXED CODE ###

import numpy as np
# import math
# import copy
# from collections import deque
import sys
input = sys.stdin.readline
# sys.setrecursionlimit(10000)
from numba import njit, i8


# @njit(i8[:](i8,i8,i8[:]))
@njit
def loof(a,N):
    M = np.zeros(2019,dtype=np.int16)
    M[0] += 1
    T = 0
    r = 1
    T += a[-1] * r
    T %= 2019
    M[T] += 1
    for i in range(N-2,-1,-1):
        r *= 10
        r %= 2019
        T += a[i] * r
        T %= 2019
        M[T] += 1
    return M


# @njit
# def pow_mod(a,n,mod):
#     memo = np.array([1])
#     if n >= 1:
#         for i in range(n-1):
#             memo = np.append(memo,memo[-1]*a%mod)
#         return memo
#     else:
#         return memo[0]


def main():
    S = input().rstrip()
    S = list(map(int,list(S)))
    a = np.array(S)

    N = len(a)

    # memo = pow_mod(10,N,2019)
    M = loof(a,N)

    res = 0

    for m in M:
        res += m * (m-1) // 2

    print(res)


main()
### BUGGY CODE ###

def count_seq_l(s):
    tmp_cnt = 0
    for s_tmp in s[::-1]:
        if s_tmp == '<':
            tmp_cnt += 1
        else:
            break

    return tmp_cnt
def count_seq_r(s):
    tmp_cnt = 0
    for s_tmp in s:
        if s_tmp == '>':
            tmp_cnt += 1
        else:
            break
    return tmp_cnt

if __name__ == '__main__':
    S = input()
    res = 0
    for i in range(len(S) + 1):
        l_s = S[:i]
        r_s = S[i:]
        l_cnt = len(l_s.split('>')[-1])
        r_cnt = len(r_s.split('<')[0])
        tmp = max(l_cnt, r_cnt)
        res += tmp
    print(res)
    

### FIXED CODE ###

if __name__ == '__main__':
    S = input()
    n = len(S)
    l_res = [0]
    r_res = [0]
    for i in range(n):
        if S[i] == '<':
            l_res.append(l_res[i] + 1)
        else:
            l_res.append(0)
    inv_S = S[::-1]

    for i in range(n):
        if inv_S[i] == '>':
            r_res.append(r_res[i] + 1)
        else:
            r_res.append(0)
    res = 0
    for l_cnt, r_cnt in zip(l_res, r_res[::-1]):
        res += max(l_cnt, r_cnt)
    print(res)
### BUGGY CODE ###

def main():
        
    import math

    N = int(input())

    for n in range(1, N + 1):
        max_itr = min(100, int(math.sqrt(n)) + 1)
        
        ans_list = []
        ans = 0
        
        for x in range(1, max_itr):
            for y in range(1, max_itr):
                for z in range(1, max_itr):
                    left_eq = x * x + y * y + z * z + x * y + y * z + z * x
                    if (left_eq == n):
                        ans += 1
        
        
        print(ans)


if __name__ == '__main__':
    main()



### FIXED CODE ###

def main():
    import math

    N = int(input())
    
    ans_list = [0 for i in range(N)]
    
    for x in range(1, 101):
        for y in range(1, 101):
            for z in range(1, 101):

                left_eq = x * x + y * y + z * z + x * y + y * z + z * x
                if (left_eq <= N):
                    ans_list[left_eq - 1] += 1
    
    for i in range(N):
        print(ans_list[i])

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

#!/usr/bin/python3r
# -*- coding:utf-8 -*-

from itertools import permutations

def main():
  n, m, nr = map(int, input().split())
  lr = list(map(lambda x:int(x)-1, input().split()))
  edges = [[10**9]*n for _ in range(n)]
  for i in range(n):
    edges[i][i] = 0
  for _ in range(m):
    a, b, c = map(int, input().split())
    a, b = a - 1, b - 1
    edges[a][b] = edges[b][a] = c
    
  def wf():
    for k in range(n):
      for i in range(n):
        for j in range(n):
          edges[i][j] = min(edges[i][j], edges[i][k] + edges[k][j])
  wf()
          
  def calc_cost(path):
    cost = 0
    for i in range(nr-1):
      cost += edges[path[i]][path[i+1]]
    return cost
  
  print(min([calc_cost(path) for path in permutations(lr)]))

if __name__=='__main__':
  main()



### FIXED CODE ###

#!/usr/bin/python3r
# -*- coding:utf-8 -*-

from itertools import permutations

def main():
  n, m, nr = map(int, input().split())
  lr = list(map(lambda x:int(x)-1, input().split()))
  edges = [[10**9]*n for _ in range(n)]
  for i in range(n):
    edges[i][i] = 0
  for _ in range(m):
    a, b, c = map(int, input().split())
    a, b = a - 1, b - 1
    edges[a][b] = edges[b][a] = c
    
  def wf():
    for k in range(n):
      for i in range(n):
        for j in range(n):
          edges[i][j] = min(edges[i][j], edges[i][k] + edges[k][j])
  wf()
          
  def calc_cost(path):
    cost = 0
    for i in range(nr-1):
      cost += edges[path[i]][path[i+1]]
    return cost
  
  print(min([calc_cost(path) for path in permutations(lr)]))

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

#!/usr/bin/env python3
import sys


def solve(N: int, M: int, A: "List[int]", B: "List[int]", C: "List[int]"):
    A.sort()
    # print(A)
    from bisect import bisect_left
    for j in range(M):
        idx = bisect_left(A, C[j])
        if(idx != 0):
            t = min(B[j],idx)
            for i in range(min(B[j],idx)):
                A[i] = C[j]
            A = A[t:idx] + A[:t] + A[idx:]
            # print(A)
            # for i in range(t): 
            #     A[i],A[idx-t+i] = A[idx-t+i],A[i]
        # print(A)
    print(sum(A))

    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    M = int(next(tokens))  # type: int
    A = [ int(next(tokens)) for _ in range(N) ]  # type: "List[int]"
    B = [int()] * (M)  # type: "List[int]" 
    C = [int()] * (M)  # type: "List[int]" 
    for i in range(M):
        B[i] = int(next(tokens))
        C[i] = int(next(tokens))
    solve(N, M, A, B, C)

if __name__ == '__main__':
    main()


### FIXED CODE ###

#!/usr/bin/env python3
import sys


def solve(N: int, M: int, A: "List[int]", B: "List[int]", C: "List[int]"):
    x = [[B[i],C[i]] for i in range(M)]
    x = sorted(x, key=lambda x: -x[1])

    A.sort()

    dn = 0
    for b, c in x:
        for j in range(b):
            if(dn >= N):
                break
            if(A[dn] < c):
                A[dn] = c
                dn += 1
            else:
                break


    print(sum(A))

    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    M = int(next(tokens))  # type: int
    A = [ int(next(tokens)) for _ in range(N) ]  # type: "List[int]"
    B = [int()] * (M)  # type: "List[int]" 
    C = [int()] * (M)  # type: "List[int]" 
    for i in range(M):
        B[i] = int(next(tokens))
        C[i] = int(next(tokens))
    solve(N, M, A, B, C)

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

def resolve():
    import sys
    import math
 
    readline = sys.stdin.readline
 
    N = int(readline())
 
    for i in range(1, N + 1):
        ans = 0
        li = int(math.sqrt(i) // 1)
        for x in range(1, li):
            for y in range(1, li):
                xx = x * x
                yy = y * y
                xy = x * y
                value = (x + y) ** 2 - 4 * (xx + yy + xy - i)
                if value <= 0:
                    continue
                cal = math.sqrt(value)
                z1 = (-(x + y) + cal) / 2
                z2 = (-(x + y) - cal) / 2
                if (1
                        and 1 <= z1
                        and z1 % 1 == 0
                        and xx + yy + z1 * z1 + xy + y * z1 + z1 * x == i):
                    ans += 1
                if (1
                        and 1 <= z2
                        and z2 % 1 == 0
                        and xx + yy + z2 * z2 + xy + y * z2 + z2 * x == i):
                    ans += 1
        print(ans)
 
 
resolve()

### FIXED CODE ###

import sys


def resolve():
    import numpy as np

    readline = sys.stdin.readline

    N = int(readline())

    f = np.zeros(10001, np.int64)

    for x in range(1, 101):
        for y in range(1, 101):
            for z in range(1, 101):
                n = x * x + y * y + z * z + x * y + y * z + z * x
                if n > 10000:
                    continue
                f[n] += 1
    for i in range(1, N + 1):
        print(f[i])

resolve()
### BUGGY CODE ###

s = input()
q = int(input())
for i in range(q):
    qy = list(input().split())
    if qy[0] == "1":
        s = s[::-1]
    else:
        if qy[1] == "1":
            s = qy[2] + s
        else:
            s = s + qy[2]
print(s)

### FIXED CODE ###

s = input()
q = int(input())
c = 0
t = ""
u = ""
for i in range(q):
    qy = list(input().split())
    if qy[0] == "1":
        c += 1
    else:
        if (qy[1] == "1" and c % 2 == 0) or (qy[1] == "2" and c % 2 == 1):
            t = qy[2] + t
        else:
            u = u + qy[2]
ans = t + s + u
if c % 2 == 0:
    print(t + s + u)
else:
    print(ans[::-1])
### BUGGY CODE ###

# B  => TLE
n, k = map(int, input().split())
h = list(map(int, input().split()))

dp = [0]*n
for i in range(1, n):
    a = 10**100
    if i >= k:
        for j in range(1, k+1):
            if a > dp[i-j] + abs(h[i-j]-h[i]):
                a = dp[i-j] + abs(h[i-j]-h[i])
    else:
        for j in range(1, i+1):
            if a > dp[i-j] + abs(h[i-j]-h[i]):
                a = dp[i-j] + abs(h[i-j]-h[i])
    dp[i] = a
    
print(dp[-1])

### FIXED CODE ###

# B  => TLE
n, k = map(int, input().split())
h = list(map(int, input().split()))

dp = [0]*n
for i in range(1, n):
    a = 10**100
    if i >= k:
        for j in range(1, k+1):
            if a > dp[i-j] + abs(h[i-j]-h[i]):
                a = dp[i-j] + abs(h[i-j]-h[i])
    else:
        for j in range(1, i+1):
            if a > dp[i-j] + abs(h[i-j]-h[i]):
                a = dp[i-j] + abs(h[i-j]-h[i])
    dp[i] = a
    
print(dp[-1])
### BUGGY CODE ###

s = input()

dp3 = 1
dp2 = 0
dp1 = 0
dp0 = 0

for i in reversed(range((len(s)))):
    m = 1
    m1 = 1
    m2 = 0
    m3 = 0
    m4 = 0
    if s[i] == '?':
        m = 3
        m1 = 3
        m2 = 1
        m3 = 1
        m4 = 1

    if s[i] == 'C':
        m2 = 1

    if s[i] == 'B':
        m3 = 1

    if s[i] == 'A':
        m4 = 1

    t_dp3 = m * dp3
    t_dp2 = m1 * dp2 + m2 * dp3
    t_dp1 = m1 * dp1 + m3 * dp2
    t_dp0 = m1 * dp0 + m4 * dp1
    dp3 = t_dp3
    dp2 = t_dp2
    dp1 = t_dp1
    dp0 = t_dp0

n = 10 ** 9 + 7
ans = dp0 % n
print(ans)

### FIXED CODE ###

s = input()

dp = [[0 for _ in range(4)] for _ in range(len(s) + 1)]
dp[len(s)][3] = 1
n = 10 ** 9 + 7

for i in reversed(range((len(s)))):
    m = 1
    m1 = 1
    m2 = 0
    m3 = 0
    m4 = 0
    if s[i] == '?':
        m = 3
        m1 = 3
        m2 = 1
        m3 = 1
        m4 = 1

    if s[i] == 'C':
        m2 = 1

    if s[i] == 'B':
        m3 = 1

    if s[i] == 'A':
        m4 = 1

    dp[i][3] = (m * dp[i+1][3]) % n
    dp[i][2] = (m1 * dp[i+1][2] + m2 * dp[i+1][3]) % n
    dp[i][1] = (m1 * dp[i+1][1] + m3 * dp[i+1][2]) % n
    dp[i][0] = (m1 * dp[i+1][0] + m4 * dp[i+1][1]) % n

ans = dp[0][0]
print(ans)
### BUGGY CODE ###

def main():
    S=input()
    N=len(S)
    A=[0]+[int(s) for s in S]
    for i in range(N):
        A[i+1] += A[i]
    del A[0]
    cnt=0
    for i in range(N-1):
        for j in range(i+1, N):
            if int(S[i:j+1])%2019==0:
                cnt+=1
    print(cnt)

main()


### FIXED CODE ###

def main():
    MOD=2019
    S=input()[::-1]
    count=[1]+[0]*MOD
    r,tmp=0,1
    for i in S:
        r += int(i)*tmp
        r %= MOD
        tmp *= 10
        tmp %= MOD
        count[r] += 1

    print(sum([i*(i-1)//2 for i in count]))

main()
### BUGGY CODE ###

A,B,C,D=map(int,input().split())
count=0
for i in range(A,B+1):
    if i%C!=0 and i%D!=0:
        count+=1
print(count)

### FIXED CODE ###

from fractions import gcd
A,B,C,D=map(int,input().split())
A-=1
lcm=C*D//gcd(C,D)
print(B-B//C-B//D+B//lcm-(A-A//C-A//D+A//lcm))
### BUGGY CODE ###

input_line = input().split()
x = int(input_line[0])
k = int(input_line[1])
d = int(input_line[2])

for i in range(k):
  if x > 0:
    x -= d
    if x <= 0:
      if (k-(i+1)) % 2 == 1:
        x += d
      break
  else:
    x += d
    if x >= 0:
      if (k-(i+1)) % 2 == 1:
        x -= d
      break   
    
print(abs(x))


### FIXED CODE ###

input_line = input().split()
x = int(input_line[0])
k = int(input_line[1])
d = int(input_line[2])

x = abs(x)
y = int(x/d)

if y < k:
  x -= y * d
  if (k-y) % 2 == 1:
    x -= d

else:
  x -= k*d
    
print(abs(x))
### BUGGY CODE ###

N = int(input())
A = list(map(int,input().split()))
ans = 0
for i in range(min(A),0,-1):
    if all( A[c] % i == 0 for c in range(N)):
        ans = i
        break   
print(ans)

### FIXED CODE ###

N = int(input())
A = list(map(int,input().split()))
A = sorted(A) # とりあえず並び替えておく
tmp = 0
for i in range(N-1):
    while A[i]>0:
        tmp = A[i]
        A[i] = A[i+1] % A[i]
        A[i+1] = tmp
print(A[N-1])
### BUGGY CODE ###

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

for i in range(N):
    sub.append(A.count(i+1))

[print(i) for i in sub]

### FIXED CODE ###

import numpy as np

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

sub = np.bincount(A, weights=None, minlength=N+1)

for i in range(N):
    print(sub[i+1])
### BUGGY CODE ###

import sys
#input = sys.stdin.buffer.readline
from collections import defaultdict

def main():
    S = input()
    
    base = 1
    cum = 0
    d = defaultdict(int)
    d[0] = 1
    ans = 0
    
    for st in S[::-1]:
        num = (int(st)*base)%2019
        base *= 10
        cum += num
        ans += d[cum%2019]
        d[cum%2019] += 1

    print(ans)
    
if __name__ == "__main__":
    main()


### FIXED CODE ###

import sys
#input = sys.stdin.buffer.readline
from collections import Counter

def main():
    S = input()
    P = 2019

    ans,base = 0,1
    MOD_list = [0]

    for st in S[::-1]:
        num = int(st)
        MOD = (MOD_list[-1]+num*base)%P
        MOD_list.append(MOD)
        base *= 10
        base %= P

    c = Counter(MOD_list)
    for v in c.values():
        ans += (v*(v-1))//2
        
    print(ans)

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

n,W=map(int,input().split())
w,v=[],[]
for i in range(n):
    x,y=map(int,input().split())
    w.append(x)
    v.append(y)
dp=[[0]*(W+1) for _ in range(n+1)]
for i in range(n):
    for j in range(W+1):
        if j-w[i]>=0:
            dp[i+1][j]=max(dp[i][j],dp[i][j-w[i]]+v[i])
        else:
            dp[i+1][j]=dp[i][j]
print(dp[n][W])

### FIXED CODE ###

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

import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees, log2, gcd
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def TUPLE(): return tuple(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7 
#mod = 998244353
from decimal import *
#import numpy as np
#decimal.getcontext().prec = 10

N, K = MAP()
A = LIST()

tmp = 1
for i in range(K):
	tmp *= A[i]

tmp2 = tmp
for i in range(K, N):
	tmp //= A[i-K]
	tmp *= A[i]
	if tmp2 < tmp:
		print("Yes")
	else:
		print("No")
	tmp2 = tmp



### FIXED CODE ###

import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees, log2, gcd
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def TUPLE(): return tuple(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7 
#mod = 998244353
#from decimal import *
#import numpy as np
#decimal.getcontext().prec = 10

def main():
	N, K = MAP()
	A = LIST()

	for i in range(K, N):
		if A[i-K] < A[i]:
			print("Yes")
		else:
			print("No")

if __name__ == '__main__':
	main()