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

n=int(input())
l=list(map(int,input().split()))
c=0
for i in range(n):
  for j in range(i+1,n):
    for k in range(j+1,n):
      if l[i]<l[j]+l[k] and l[j]<l[i]+l[k] and l[k]<l[i]+l[j]:
        c+=1
print(c)

### FIXED CODE ###

n=int(input())
l=list(map(int,input().split()))
c=0
dp=[]
l.sort()
for i in range(n-2):
  k=i+2
  for j in range(i+1,n-1):
    while k<n and (l[i]+l[j])>l[k]:
      k+=1
    c+=k-j-1
print(c)

'''

1 2 3 4

1 < 2+3
2 < 1+3
3 < 1+2

6 - 1 = 5
6 - 2 = 4
6 - 3 = 3

'''
### BUGGY CODE ###

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

s1, s2, s3 = 10000, 5000, 1000
ok_flg = False

for i in range(N + 1) :
    if Y - i * s1 <= (N - i) * s2 :
        for j in range(N - i + 1) :
            if Y - i*s1 - j*s2 <= (N - i - j)*s3 :
                for k in range(N - i - j + 1) :
                    # print("DBG : ", i, j, k, s1, s2, s3)
                    if i + j + k == N and i*s1 + j*s2 + k*s3 == Y :
                        print(i, j, k)
                        ok_flg = True
                        break
                if ok_flg == True :
                    break
        if ok_flg == True :
            break
        
if ok_flg == False :
    print("-1 -1 -1")

### FIXED CODE ###

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

s1, s2, s3 = 10, 5, 1
ok_flg = False

if Y % 1000 != 0 :
    print("-1 -1 -1")    
else :
    y_small = int(Y / 1000)
    for i in range(N + 1) :
        if y_small - i * s1 <= (N - i) * s2 :
            for j in range(N - i + 1) :
                if i + j <= N and i*s1 + j*s2 + (N - i - j)*s3 == y_small :
                    print(i, j, N - i - j)
                    ok_flg = True
                    break
                if ok_flg == True :
                    break
            if ok_flg == True :
                break
    if ok_flg == False :
        print("-1 -1 -1")
### BUGGY CODE ###

k,n=map(int,input().split())
a=list(map(int,input().split()))
resf=10**8
for i in a:
    if i==a[0]:
        res=min(a[-1]-a[0],k-(a[1]-a[0]))
    elif i==a[-1]:
        res=min(k-(a[-1]-a[-2]),a[-1]-a[0])
    else:
        res=min(k-(a[a.index(i)+1]-i),k-(i-a[a.index(i)-1]))
    resf=min(resf,res)
print(resf)

### FIXED CODE ###

# coding: utf-8
# Your code here!
def main():
    k,n=map(int,input().split())
    a=list(map(int,input().split()))
    resf=10**7
    z=0
    for i in a:
        if i==a[0]:
            res=min(a[-1]-a[0],k-(a[1]-a[0]))
        elif i==a[-1]:
            res=min(k-(a[-1]-a[-2]),a[-1]-a[0])
        else:
            if k-(a[z+1]-i)<=k-(i-a[z-1]):
                res=k-(a[z+1]-i)
            else:
                res=k-(i-a[z-1])
        if resf>=res:
            resf=res
        z+=1
    print(resf)

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

k = int(input())
a = [int(i) for i in input().split()]
m = sum([i for i in a]) - k + 2
l = []
for n in range(max(a), m+1):
    c = n
    q = 0
    for i in a:
        c -= c % i
        q += c // i
    if c == 2: l.append(n)
    if q > m + 1: break
    if c > 2: break
if len(l) == 0: print(-1)
else: print(l[0], l[-1])

### FIXED CODE ###

from math import floor, ceil
k = int(input())
a = [int(i) for i in input().split()]
l,r = 2,2
for ai in a[::-1]:
    xi = ceil(l/ai)
    yi = floor(r/ai)
    if xi > yi:
        print(-1)
        exit()
    l = xi * ai
    r = yi * ai + ai - 1
print(l, r)
### BUGGY CODE ###

import sys
readline = sys.stdin.readline
read = sys.stdin.read

N, M = map(int, readline().split())

if M == 0:
    print('Yes')
    exit()

*LRD, = map(int, read().split())
graph = [[] for _ in range(N + 1)]

# 根からの距離、根は複数の可能性あり
distance = [-1] * (N + 1)
child = [0] * (N + 1)

for L, R, D in zip(*[iter(LRD)] * 3):
    graph[L].append((R, D))
    child[R] = 1

for i in range(1, N + 1):
    if child[i]:
        continue

    # 以下iは根
    distance[i] = 0
    stack = [i]
    while stack:
        V = stack.pop()
        for v, d in graph[V]:
            if distance[v] == -1:
                distance[v] = distance[V] + d
            else:
                if distance[v] != distance[V] + d:
                    print('No')
                    exit()

            stack.append(v)

# 例4のような循環タイプは上のfor内で処理されない
if -1 in distance[1:]:
    print('No')
else:
    print('Yes')

### FIXED CODE ###

import sys
readline = sys.stdin.readline
read = sys.stdin.read

N, M = map(int, readline().split())

if M == 0:
    print('Yes')
    exit()

LRD = map(int, read().split())
graph = [[] for _ in range(N + 1)]

# 根からの距離、根は複数の可能性あり
distance = [-1] * (N + 1)
child = [0] * (N + 1)

for L, R, D in zip(LRD, LRD, LRD):
    graph[L].append((R, D))
    child[R] = 1

for i in range(1, N + 1):
    if child[i]:
        continue

    # 以下iは根
    distance[i] = 0
    stack = [i]
    while stack:
        V = stack.pop()
        for v, d in graph[V]:
            if distance[v] == -1:
                distance[v] = distance[V] + d
                stack.append(v)
            else:
                if distance[v] != distance[V] + d:
                    print('No')
                    exit()

# 例4のような循環タイプは上のfor内で処理されない
if -1 in set(distance[1:]):
    print('No')
else:
    print('Yes')
### BUGGY CODE ###



def main():
    string = input().strip()
    k = int(input())
    s = set()
    length = len(string)
    for i in range(length):
        for j in range(i, length):
            s.add(string[i:j+1])
    print(sorted(s)[k - 1])


if __name__ == '__main__':
    main()


### FIXED CODE ###

def main():
    string = input().strip()
    k = int(input())
    s = set()
    for char in sorted(set(string)):
        for i in range(len(string)):
            if string[i] == char:
                s.add(string[i])
                s.add(string[i:i+1])
                s.add(string[i:i+2])
                s.add(string[i:i+3])
                s.add(string[i:i+4])
                s.add(string[i:i+5])
        if len(s) >= k:
            print(sorted(s)[k - 1])
            return


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

import numpy
n, m = map(int, input().split())
a = []
b = []

for i in range(n):
    ta, tb = map(int, input().split())
    a.append(ta)
    b.append(tb)

cost = 0
while m > 0:
    tv = min(a)
    ti = a.index(tv)
    if m > b[ti]:
        m = m - b[ti]
        a[ti] = 10000000000
        cost += tv * b[ti]
    else:
        a[ti] = 10000000000
        cost += tv * m
        m = 0 

print(cost)

### FIXED CODE ###

import numpy
n, m = map(int, input().split())
a = []
b = []

value = [] 

for i in range(n):
    ta, tb = map(int, input().split())
    value.append((ta, tb))

value.sort(key=(lambda x: x[0]))

cost = 0
for i in range(n):
    if m > value[i][1]:
        cost += value[i][1] * value[i][0]
        m -= value[i][1]
    else:
        cost += value[i][0] * m
        m = 0

print(cost)
### BUGGY CODE ###

N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
C = list(map(int,input().split()))
ck = 0
for i in range(0, N):
    for j in range(0, N):
        for k in range(0, N):
            if A[i] < B[j] < C[k]:
                ck = ck + 1
else:
    print(ck)


### FIXED CODE ###

n = int(input())
A = sorted(list(map(int,input().split())))
B = sorted(list(map(int,input().split())))
C = sorted(list(map(int,input().split())))
count = 0

A.insert(0,-1)
A.append(10e+10)
C.insert(0,-1)
C.append(10e+10)

for bi in B:
    left = 0
    right = n+1
    
    while right-left>1:
        middle = (left+right) //2
        if A[middle]>=bi:
            right = middle
        else:
            left = middle
    a_count = left

    left = 0
    right = n+1
    while right-left>1:
        middle = (left+right) //2
        if C[middle]>bi:
            right = middle
        else:
            left = middle
    c_count = n+1-right

    count += a_count*c_count

print(count)
### BUGGY CODE ###

N, M = map(int, input().split())
treat = list(map(int, input().split()))
count = 0
for n in range(N):
    for m in range(n, N):
        if sum(treat[n:m+1]) % M == 0:
            count += 1


print(count)

### FIXED CODE ###

from collections import Counter
N, M = map(int, input().split())
A = list(map(lambda x:int(x)%M, input().split()))
B = A[:]
for i in range(N-1):
    B[i+1] += B[i]
    B[i+1] %= M
c = Counter(B)


ans = 0
for k, v in c.items():
    if k == 0:
        ans += v
    if v >= 2:
        ans += v*(v-1)//2
print(ans)
### BUGGY CODE ###

def main():
    n = int(input())
    a = list(map(int, input().split()))
    x, y = a[0], a[1]
    nim = 0
    for i in range(2, n):
        nim ^= a[i]
    ans = 0

    while((x ^ y) != nim):
        for i in range(50, -1, -1):
            j = (nim >> i) & 1
            xy = ((x >> i) ^ (y >> i)) & 1
            if j != xy:
                m = min(x % (2**i)+1, 2**i-(y % (2**i)))
                if x % (2**i)+1 == 2**i-(y % (2**i)):
                    print(-1)
                    return
                x -= m
                y += m
                ans += m
                break
        else:
            if (x ^ y) != nim:
                print(-1)
                return
        if x == 0:
            print(-1)
            return
    print(ans)


main()


### FIXED CODE ###

def main():
    n = int(input())
    a = list(map(int, input().split()))
    x, y = a[0], a[1]
    nim = 0
    for i in range(2, n):
        nim ^= a[i]
    ans = 0

    while((x ^ y) != nim):
        for i in range(50, -1, -1):
            j = (nim >> i) & 1
            xy = ((x >> i) ^ (y >> i)) & 1
            if j != xy:
                m = min(x % (2**i)+1, 2**i-(y % (2**i)))
                if x % (2**i)+1 == 2**i-(y % (2**i)):
                    print(-1)
                    return
                x -= m
                y += m
                ans += m
                if x <= 0:
                    print(-1)
                    return
                break
        else:
            if (x ^ y) != nim:
                print(-1)
                return
    print(ans)


main()
### BUGGY CODE ###

from math import ceil

N,K = map(int,input().split())
A = sorted([int(i) for i in input().split()]) # 消化コスト
F = sorted([int(i) for i in input().split()],reverse = True) # 食べにくさ
# K: 修行の回数

cost = [a*f for a,f in zip(A,F)]

# にぶたん
# K回以下の修行でチーム成績がMになるか
# Mを固定して考える
def grade_is(M:int):
    training = 0
    for i in range(N):
        if cost[i] > M:
            training += ceil((cost[i] - M) / F[i])
    return training <= K

ok = 10 ** 18 + 1
ng = -1
while ok - ng > 1:
    mid = (ok + ng) // 2
    if grade_is(mid):
        ok = mid
    else:
        ng = mid

print(ok)

### FIXED CODE ###

from math import ceil
 
N, K = map(int,input().split())
A = sorted([int(i) for i in input().split()])
F = sorted([int(i) for i in input().split()],reverse=True)
# メンバーそれぞれが完食にかかる時間のリスト
cost = [A[i]*F[i] for i in range(N)]
 
# K回の修行でチーム成績がxになるか
def grade_is_x(x):
    training = 0
    for i in range(N):
        if cost[i] > x:
            training += ceil((cost[i]-x)/F[i])
            if training > K:
                return False
    return True
 
# 二分探索でxの最小値を求める
cost_max = max(cost)
ok = cost_max
ng = max(-1,max(cost)-K*F[cost.index(cost_max)])
while (ok - ng) != 1:
    mid = (ok + ng) // 2
    if grade_is_x(mid):
        ok = mid
    else:
        ng = mid
print(ok)
### BUGGY CODE ###


def main():
    import sys
    import time
    input = sys.stdin.buffer.readline
    start = time.time()
    N = int(input())
    A = [tuple(map(int, input().split())) for i in range(N)]

    id = [0]*N
    Lock = [-1]*N
    ans = 0
    min_id = 0
    M = (N*(N-1)) // 2

    while(min_id < N-1):
        now = time.time()
        if now - start > 2:
            ans = M
            break
        ans += 1
        if ans > M:
            break
        tmp = set()
        for i in range(N):
            if id[i] >= N-1:
                continue
            else:
                if Lock[i] >= 0:
                    continue
                else:
                    a = A[i][id[i]]
                    if Lock[a-1] == i and i not in tmp:
                        Lock[a-1] = -1
                        id[a-1] += 1
                        tmp.add(a-1)
                        id[i] += 1
                    else:
                        if i not in tmp:
                            Lock[i] = A[i][id[i]]-1
        min_id = min(id)
    if ans > M:
        print(-1)
    else:
        print(ans)


main()


### FIXED CODE ###

def main():
    import sys
    import time
    input = sys.stdin.buffer.readline
    start = time.time()
    N = int(input())
    A = [tuple(map(int, input().split())) for i in range(N)]

    id = [0]*N
    Lock = [-1]*N
    ans = 0
    min_id = 0
    M = (N*(N-1)) // 2

    while(min_id < N-1):
        now = time.time()
        if now - start > 1.9:
            ans = M
            break
        ans += 1
        if ans > M:
            break
        tmp = set()
        for i in range(N):
            if id[i] >= N-1:
                continue
            else:
                if Lock[i] >= 0:
                    continue
                else:
                    a = A[i][id[i]]
                    if Lock[a-1] == i and i not in tmp:
                        Lock[a-1] = -1
                        id[a-1] += 1
                        tmp.add(a-1)
                        id[i] += 1
                    else:
                        if i not in tmp:
                            Lock[i] = A[i][id[i]]-1
        min_id = min(id)
    if ans > M:
        print(-1)
    else:
        print(ans)


main()
### BUGGY CODE ###

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

cnt = 0
for i in range(n):
  cnt_j = 0
  cnt_j = sum([1 for j in range(i+1) if p[i] <= p[j]])
  if cnt_j == i+1:
    cnt += 1
print(cnt)



### FIXED CODE ###

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

cnt = 0
p_min = p[0]
for i in range(n):
  pi = p[i]
  if pi <= p_min:
    cnt += 1
    p_min = pi
print(cnt)
### BUGGY CODE ###

#!/usr/bin/env python3
#CODEFESTIVAL2016 qual A C

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(1000000000)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

s = input()
k = I()
n = len(s)
alpha = 'abcdefghijklmnopqrstuvwxyz'
ans = ''
for i in range(n-1):
    a = 26 - alpha.index(s[i])
    if a <= k:
        k -= a
        ans += 'a'
    else:
        ans += s[i]
if k > 0:
    tmp = alpha.index(s[-1])
    ans += alpha[(tmp + k % 26) % 26]
print(ans)


### FIXED CODE ###

#!/usr/bin/env python3
#CODEFESTIVAL2016 qual A C

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(1000000000)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

s = input()
k = I()
n = len(s)
alpha = 'abcdefghijklmnopqrstuvwxyz'
ans = ''
for i in range(n-1):
    a = 26 - alpha.index(s[i])
    if s[i] == 'a':
        ans += s[i]
        continue
    if a <= k:
        k -= a
        ans += 'a'
    else:
        ans += s[i]
if k > 0:
    tmp = alpha.index(s[-1])
    ans += alpha[(tmp + k % 26) % 26]
else:
    ans += s[-1]
print(ans)
### BUGGY CODE ###

n=int(input())
l=[0]+list(map(int,input().split()))
for i in range(1,n+1):
  l[i]+=l[i-1]
s=set(l)
ans=0
for i in s:
  a=l.count(i)
  ans+=a*(a-1)//2
print(ans)

### FIXED CODE ###

n=int(input())
l=[0]+list(map(int,input().split()))
for i in range(1,n+1):
  l[i]+=l[i-1]
d={}
for i in l:
  if i not in d:
    d[i]=1
  else:
    d[i]+=1
ans=0
for a in d.values():
  ans+=a*(a-1)//2
print(ans)
### BUGGY CODE ###

from sys import stdin
from sys import setrecursionlimit

setrecursionlimit(10 ** 7)

n,m,k = map(int,stdin.readline().rstrip().split())
mod = 998244353
point = 0

def combination(n,r,mod=mod):
    r=min(r,n-r)
    up,down=1,1
    for i in range(r):
        up=up*(n-i)%mod
        down=down*(i+1)%mod
    return up*pow(down,mod-2,mod)%mod

li = [0]*(n+1)
for i in range(n+1):
    li[i] = combination(n-1,i)%mod

col = m
for i in range(n-1,-1,-1):
    now = col
    now *= li[i]
    if i <= k:
        point += now%mod
    col *= m-1
    col %= mod

print(point%mod)

### FIXED CODE ###

from sys import stdin
from sys import setrecursionlimit

setrecursionlimit(10 ** 7)

n,m,k = map(int,stdin.readline().rstrip().split())
mod = 998244353
wariate = 1
point = 0

def prepare(n, MOD=mod):
    facts = [1]*(n+1)
    for i in range(1, n+1):
        facts[i] = facts[i-1]*i%MOD
    invs = [1]*(n+1)
    invs[n] = pow(facts[n], MOD-2, MOD)
    for i in range(0, n)[::-1]:
        invs[i] = invs[i+1] * (i+1) % MOD
    return facts, invs
facts, invs = prepare(n, mod)
for i in range(n-1,-1,-1):
    now = m
    if i != n-1:
        wariate *= m-1
        wariate %= mod
    now *= wariate%mod

    now *= facts[n-1]*invs[n-1-i]*invs[i]
    if i <= k:
        point += now%mod

print(point%mod)
### 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())

for i in range(A,min(A+K,B+1)):
    print(i)
    
for i in range(max(A+K,B-K+1),B+1):
    print(i)
### BUGGY CODE ###

S = input()
Q = int(input())

for _ in range(Q):
  TFC = input()
  if len(TFC) == 1: # T == 1
    S = S[::-1]
  else:
    T, F, C = (i for i in TFC.split())  
    if F == '1':
      S = C + S
    else:
      S = S + C
  
print(S)

### FIXED CODE ###

from collections import deque

S = input()
Q = int(input())

q = deque()
rev = 0

for s in S:
  q.append(s)

for _ in range(Q):
  TFC = input()
  if len(TFC) == 1: # T == 1
    rev ^= 1
  else:
    T, F, C = (i for i in TFC.split())  
    if (F == '2' and not rev) or (F == '1' and rev):
      q.append(C)
    else:
      q.appendleft(C)
      
ans = ''.join(q)

if rev:
  print(ans[::-1])
else:
  print(ans)
### BUGGY CODE ###

H,W,D=map(int,input().split())
Li=[]

for i in range(1,H+1):
    s=list(map(int,input().split()))
    for j in range(1,W+1):
        Li.append([s[j-1],i,j])
Li.sort()
#print(Li)
Q=int(input())
for x in range(Q):
     L,R=map(int,input().split())
     sum=0
     for y in range(1000000):
         if L==R:
             print(sum)
             break
         else:
             sum+=abs(Li[L-1][1]-Li[L-1+D][1])+abs(Li[L-1][2]-Li[L-1+D][2])
             L+=D

### FIXED CODE ###

H,W,D=map(int,input().split())
L=[0 for i in range(H*W+1)]
A=[]
for i in range(H):
    a=list(map(int,input().split()))
    A.append(a)
    
for i in range(H):
    for j in range(W):
        L[A[i][j]]=[i+1,j+1]
L[0]=[0,0]
#print(L)
l=[0 for i in range(H*W+1)]
for i in range(D):
    for j in range(H*W+1):
        if (i+j*D)>(H*W):
            break
        elif j==0:
            l[i+j*D]=0
        else:
            l[i+j*D]=l[i+(j-1)*D]+abs(L[i+j*D][0]-L[i+(j-1)*D][0])+abs(L[i+j*D][1]-L[i+(j-1)*D][1])
#print(l)
Q=int(input())
for i in range(Q):
    a,b=map(int,input().split())
    print(l[b]-l[a])
### BUGGY CODE ###

n = int(input())
s = input()
cnt =0
for i in range(len(s)-2):
    for j in range(i+1,len(s)-1):
        for k in range(j+1,len(s)):
            if s[i]!=s[j] and s[i]!=s[k] and s[j]!=s[k]:
                if j-i!=k-j:
                    cnt+=1
print(cnt)

### FIXED CODE ###

n = int(input())
s = input()
r,g,b =0,0,0
ls = len(s)
for i in range(ls):
    if s[i]=='R':
        r+=1
    elif s[i]=='G':
        g+=1
    elif s[i]=='B':
        b+=1
cnt =0
for j in range(1,ls-1):
    for i in range(j):
        k = 2*j-i
        if k<ls:
            if s[i]!=s[j] and s[i]!=s[k] and s[j]!=s[k]:
                cnt+=1
print(r*g*b-cnt)
### BUGGY CODE ###

import numpy as np
import math
N,a,b = np.array(input().split()).astype(int)
print(2**N-1-math.factorial(N)//(math.factorial(a)*math.factorial(N-a))-math.factorial(N)//(math.factorial(b)*math.factorial(N-b)))

### FIXED CODE ###

import numpy as np
N,a,b = np.array(input().split()).astype(int)
mod = 10**9+7
def power(x, n):
    ans = 1
    while(n > 0):
        if(bin(n & 1) == bin(1)):
            ans = ans*x%mod
        x = (x*x)%mod
        n = n >> 1 #ビットシフト
    return ans
def fact(m, n):
    val = 1
    for i in range(m, n+1):
        val = val*i % mod
    return val
    
def cmb1(N, r):
    A = fact(N-r+1, N)%mod
    B = fact(1, r)%mod
    return A, B, (A*power(B, mod-2))%mod
def cmb2(a, b, A, B):
    A = fact(N-a+1, N-b)*A%mod
    B = fact(b+1, a)*B%mod
    return (A*power(B, mod-2))%mod
if(a>N//2):
    a = N-a
if(b>N//2):
    b = N-b
tmp = max(a,b)
b = min(a,b)
a = tmp
A, B, K1 = cmb1(N, b)
K2 = cmb2(a, b, A, B)
print((power(2, N)-1-K1-K2)%mod)
### BUGGY CODE ###

from sys import stdin

num = int(input())

list2 = ["END"]
cur = list2.index("END")

for i in range(num):
	cmd = stdin.readline().strip().split()

	if cmd[0] == "0":
		list2.insert(cur,cmd[1])
	elif cmd[0] == "1":
		cur += int(cmd[1])
	else:
		list2.pop(cur)

list2.remove("END")
print(*list2,sep='\n')



### FIXED CODE ###

from sys import stdin

class QueueNode(object):
	def __init__(self,data,next=None,prev=None):
		self.data = data
		self.next = next
		self.prev = prev

class LinkList(object):
	def __init__(self,head=None):
		self.head = head
		self.tail = head
		self.cur  = head

	def insert_q(self,data):
		node = QueueNode(data)

		if self.cur is None:
			self.head = node
			self.tail = node
			self.cur  = node
			return

		currentNode = self.cur
		preNode = currentNode.prev

		if currentNode.prev is None:
			currentNode.prev = node
			node.next = currentNode
			self.head = self.cur = node
		else:
			if self.tail is not None:
				currentNode.prev = node
				node.prev = preNode
				node.next = currentNode
				preNode.next = node
				self.cur = node
			else:
				currentNode.next = node
				node.prev = currentNode
				node.next = None
				self.cur = node
				self.tail = node


	def move_q(self,mv):
		currentNode = self.cur
		cnt = mv
		while cnt != 0:
			if mv < 0:#prev
				if currentNode.prev is None:
					self.head = self.cur = currentNode
					break
				else:
					currentNode = currentNode.prev
					self.cur = currentNode
					cnt += 1
			else:#next
				if currentNode.next is None:
					self.cur = currentNode
					break
				else:
					currentNode = currentNode.next
					self.cur = currentNode
					cnt -= 1


	#カレントを削除する
	def delete_q(self):
		currentNode = self.cur
		nexNode = currentNode.next
		preNode = currentNode.prev

		#自身の前がいない（=先頭）
		if preNode is None:
			nexNode.prev = None
			self.head = nexNode
			self.cur = nexNode
		#自身の後ろがいない（=末尾）
		elif nexNode is None:
			preNode.next = None
			self.tail = None
		else:
			preNode.next = currentNode.next
			nexNode.prev = currentNode.prev
			self.cur = currentNode.next

	#先頭を表示する
	def print_q(self):
		if self.head is not None:
			print(self.head.data)

	#全体表示（先頭から）
	def print_all(self):
		if self.head is not None:
			currentNode = self.head
			while currentNode.next is not None:
				print(currentNode.data)
				currentNode = currentNode.next

if __name__ == '__main__':

	loopnum = int(input())

	ll = LinkList()
	ll.insert_q("E")
	for i in range(loopnum):
		cmd = stdin.readline().strip().split()
		if cmd[0] == "0":
			t = int(cmd[1])
			ll.insert_q(t)
		elif cmd[0] == "1":
			t = int(cmd[1])
			ll.move_q(t)
		else:
			ll.delete_q()
	ll.print_all()
### BUGGY CODE ###

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

point = [0] * (N - K + 1)

for i in range(N - K + 1):
    tmplist = A[i : i + K]
    tmppoint = tmplist[0]

    for j in range(1, K):
        tmppoint = tmppoint * tmplist[j]

    point[i] = tmppoint

k = 0
while k < (N - K):
    if point[k] < point[k + 1]:
        print("Yes")
    else:
        print("No")
    k = k + 1



### FIXED CODE ###

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

i = 0
while i < N - K:
    if A[i] < A[i + K]:
        print("Yes")
    else:
        print("No")
    i = i + 1