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

from collections import deque


walk = [(1, 0), (-1, 0), (0, 1), (0, -1)]
warp = [(-2, -2), (-2, -1), (-2, 0), (-2, 1), (-2, 2),
        (-1, -2), (-1, -1), (-1, 0), (-1, 1), (-1, 2),
        (0, -2), (0, -1), (0, 1), (0, 2),
        (1, -2), (1, -1), (1, 0), (1, 1), (1, 2),
        (2, -2), (2, -1), (2, 0), (2, 1), (2, 2),]


def get_warped(walked, map_):
    warped = deque()
    while walked:
        h, w = walked.popleft()
        for i, j in warp:
            h2 = h + i
            w2 = w + j
            if -1 < h2 < H and -1 < w2 < W and map_[h2][w2] == '.':
                warped.append((h2, w2))
                map_[h2][w2] = map_[h][w] + 1
    return warped, map_


def get_walked(candidate, map_):
    walked = deque()
    while candidate:
        h, w = candidate.popleft()
        walked.append((h, w))
        for i, j in walk:
            h2 = h + i
            w2 = w + j
            if -1 < h2 < H and -1 < w2 < W and map_[h2][w2] == '.':
                candidate.append((h2, w2))
                map_[h2][w2] = map_[h][w]
    return walked, map_

H, W = map(int, input().split())
s_h, s_w = [i-1 for i in map(int, input().split())]
d_h, d_w = [i-1 for i in map(int, input().split())]
map_ = [list(input()) for i in range(H)]

candidate = deque([(s_h, s_w)])
map_[s_h][s_w] = 0

while candidate:
    walked, map_ = get_walked(candidate, map_)
    candidate, map_ = get_warped(walked, map_)

for h in range(H):
    for w in range(W):
        if map_[h][w] == '.':
            map_[h][w] = -1

print(map_[d_h][d_w])


### FIXED CODE ###

from collections import deque
 
 
walk = [(1, 0), (-1, 0), (0, 1), (0, -1)]
warp = [(-2, -2), (-2, -1), (-2, 0), (-2, 1), (-2, 2),
        (-1, -2), (-1, -1), (-1, 0), (-1, 1), (-1, 2),
        (0, -2), (0, -1), (0, 1), (0, 2),
        (1, -2), (1, -1), (1, 0), (1, 1), (1, 2),
        (2, -2), (2, -1), (2, 0), (2, 1), (2, 2),]
 
 
def get_warped(walked, map_):
    warped = deque()
    while walked:
        h, w = walked.popleft()
        for i, j in warp:
            h2 = h + i
            w2 = w + j
            if -1 < h2 < H and -1 < w2 < W and map_[h2][w2] == '.':
                warped.append((h2, w2))
                map_[h2][w2] = map_[h][w] + 1
    return warped, map_
 
 
def get_walked(candidate, map_):
    walked = deque()
    while candidate:
        h, w = candidate.popleft()
        walked.append((h, w))
        for i, j in walk:
            h2 = h + i
            w2 = w + j
            if -1 < h2 < H and -1 < w2 < W and map_[h2][w2] == '.':
                candidate.append((h2, w2))
                map_[h2][w2] = map_[h][w]
    return walked, map_
 
H, W = map(int, input().split())
s_h, s_w = [i-1 for i in map(int, input().split())]
d_h, d_w = [i-1 for i in map(int, input().split())]
map_ = [list(input()) for i in range(H)]
 
candidate = deque([(s_h, s_w)])
map_[s_h][s_w] = 0
 
while candidate:
    walked, map_ = get_walked(candidate, map_)
    candidate, map_ = get_warped(walked, map_)
 
for h in range(H):
    for w in range(W):
        if map_[h][w] == '.':
            map_[h][w] = -1
 
print(map_[d_h][d_w])
### BUGGY CODE ###

import math
k = int(input())
ans = 0
for i in range(1, k+1):
    for j in range(1, k+1):
        for k in range(1, k+1):
            ans += math.gcd(math.gcd(i, j), k)

print(ans)

### FIXED CODE ###

import math
n = int(input())
ans = 0
for i in range(1, n+1):
    for j in range(1, n+1):
        t = math.gcd(i, j)
        for k in range(1, n+1):
            ans += math.gcd(t, k)
print(ans)
### BUGGY CODE ###

import sys
N,Q = map(int,input().split())
S = input()
input = sys.stdin.readline
lr = [[int(i) for i in input().split()] for i in range(Q)]
C = []
for i in range(N-1):
    if S[i] == "A":
        if S[i+1] == "C":
            C.append(i)
for i in lr:
    AC = 0
    for j in C:
        if j >= i[0]-1:
            if j < i[1]-1:
                AC += 1
            else:
                break
    print(AC)

### FIXED CODE ###

import sys
input = sys.stdin.readline
N,Q = map(int,input().split())
S = input()
lr = [[int(i) for i in input().split()] for i in range(Q)]
C = [0]*(N+1)
terget = "AC"
index = -1
for i in range(N):
    C[i+1] = C[i] + (S[i:i+2] == "AC")
for l,r in lr:
    print(C[r-1] - C[l-1])
### BUGGY CODE ###

import numpy as np
import sys
import math
read = sys.stdin.readline

N = int(read().rstrip())
A = list(map(int,read().rstrip().split()))
da = []
for i , a in enumerate(A):
    da.append([i,a])

sumN = [0] * N
for i , a in enumerate(A):
    sumN[i] = i + a + 1


newA = sorted(da , key = lambda x:(x[1]))
ans = 0
for s in sumN :
    for a in newA :
        if s + a[1] > 200000:
            break

        if s  + a[1]  == a[0] + 1:
            ans += 1

print(ans)  


### FIXED CODE ###

import numpy as np
import sys
import math
read = sys.stdin.readline

N = int(read().rstrip())
A = list(map(int,read().rstrip().split()))
da = []
for i , a in enumerate(A):
    da.append([i,a])

dR = {}
dL = {}

ans = 0
for d in reversed(da):
    r = d[0] + d[1] + 1
    l = d[0] - d[1] + 1 
    if r in dR:
        dR[r] += 1
    else:
        dR[r] = 1

    if r in dL:
        ans += dL[r]

    if l in dL :
        dL[l] += 1
    else:
        dL[l] = 1  

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

N,A = map(int,input().split())
X = [int(e) for e in input().split()]
# dp[i][k][s]: i番目まで見てk個選んで総和sとなる場合の数
# 初期条件: dp[0][0][0] = 1
# 遷移: dp[i][k][s] += dp[i-1][k-1][s-X[i]] + dp[i-1][k][s]
# 答え: sum(dp[N][k][k*A] 1 <= k <= N)
s_max = 2500
dp = [[[0]*(s_max+1) for k in range(N+1)] for i in range(N+1)]
dp[0][0][0] = 1
for i in range(1,N+1):
    for k in range(N+1):
        for s in range(s_max+1):
            dp[i][k][s] += dp[i-1][k][s]
            if k != 0 and 0 <= s-X[i-1] <= s_max:
                dp[i][k][s] += dp[i-1][k-1][s-X[i-1]]
ans = 0
for k in range(1,N+1):
    s = k*A
    ans += dp[N][k][s]
print(ans)

### FIXED CODE ###

N,A = map(int,input().split())
X = [int(e)-A for e in input().split()]
# dp[i][s]: i番目まで見て部分和がsとなるような場合の数
# 初期条件: dp[0][0] = 1
# 遷移: dp[i][s] += dp[i-1][s-X[i]] + dp[i-1][s]
# 答え: dp[N][0]
s_max = 5001
dp = [[0]*(s_max+1) for i in range(N+1)]
dp[0][2500] = 1
for i in range(1,N+1):
    for s in range(s_max+1):
        if 0 <= s-X[i-1] <= s_max:
            dp[i][s] += dp[i-1][s-X[i-1]]
        dp[i][s] += dp[i-1][s]
# 全てを選ばなかった1通りは除外
ans = dp[N][2500] - 1
print(ans)
### BUGGY CODE ###

import fractions
n = int(input())
a = list(map(int, input().split()))
lcm = a[0]
ans = 0
for i in range(1, n):
    lcm = lcm * a[i] // fractions.gcd(lcm, a[i])
for i in range(0, n):
    ans += lcm//a[i]
print(ans%(10**9+7))

### FIXED CODE ###

import fractions
n = int(input())
a = list(map(int, input().split()))
lcm = a[0]
ans = 0
for i in range(1, n):
    lcm = lcm * a[i] // fractions.gcd(lcm, a[i])
for i in range(0, n):
    ans += lcm//a[i]
print(ans%(10**9+7))
### BUGGY CODE ###

import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy,copy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd


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()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

def main():
    a, b, c, d = MAP()
    l = gcd(c, d) * c * d
    ct = 0
    for i in range(a, b + 1):
        if i % c!= 0 and i%d!=0:
            ct += 1
    print(ct)
    
if __name__ == '__main__':
    main()

### FIXED CODE ###

import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy,copy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd


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()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

def main():
    a, b, c, d = MAP()

    l = c * d // gcd(c, d)
    a -= 1

    kukan1 = b - b // c - b // d + b // l
    kukan2 = a - a // c - a // d + a // l

    print(kukan1 - kukan2)


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

N = int(input())
P = list(map(int, input().split()))
ans = 0
for i in range(N):
    partP = P[:i+1]
    cnt = 0
    for p in partP:
        if P[i] <= p:
            cnt += 1
        else:
            continue
    if cnt == len(partP):
        ans += 1

print(ans)

### FIXED CODE ###

N = int(input())
P = list(map(int, input().split()))
ans =1 
newP = P[0]
for i in range(1, N):
    newP = (min(newP, P[i]))
    if newP == P[i]:
        ans += 1

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

import sys
input = sys.stdin.buffer.readline
from operator import itemgetter

def main():
    H,N = map(int,input().split())
    INF = 10**10
    at = []
    for _ in range(N):
        A,B = map(int,input().split())
        at.append((A,B))
        
    at.sort(key=itemgetter(0))
    
    dp = [INF for _ in range(H+1)]
    dp[0] = 0
    for i in range(N):
        use,a = at[i]
        for j in range(1,H+1):
            if j < use:
                dp[j] = min(dp[j],a)
            else:
                dp[j] = min(dp[j],dp[j-use]+a)
        
    print(dp[-1])
    
if __name__ == "__main__":
    main()

### FIXED CODE ###

import sys
input = sys.stdin.buffer.readline

def main():
    H,N = map(int,input().split())
    x = []
    ma = 0
    for _ in range(N):
        a,b = map(int,input().split())
        ma = max(ma,a)
        x.append((a,b))
    INF = 10**18
    
    dp = [INF for _ in range(H+ma+1)]
    dp[0] = 0
    for i in range(1,H+ma+1):
        dp[i] = min(dp[i-a]+b for a,b in x)
    
    print(min(dp[H:]))

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

s = list(map(lambda x: int(x),list(input())))
p = [0 for i in range(2019)]
n = len(s)
ans = 0
kar = 0
for i in range(n):
    kar = kar + s[n-1-i]*10**i
    p[kar%2019] += 1

for i in range(2019):
    ans += p[i]*(p[i]-1)//2
    if i == 0:
        ans += p[i]
print(ans)

### FIXED CODE ###

s = list(input())
p = [0 for i in range(2019)]
n = len(s)
ans = 0
kar = 0
dig = 1
for i in range(n):
    kar = (kar + int(s[n-1-i])*dig)%2019
    dig = (dig*10)%2019
    p[kar] += 1

for i in range(2019):
    ans += p[i]*(p[i]-1)//2
    if i == 0:
        ans += p[i]
print(ans)
### BUGGY CODE ###

N=int(input())
S=input()
R=[]
G=[]
B=[]

def binary_search(A,n):
    find=False
    start=0
    end=len(A)
    if len(A)==1 and A[0]==n:
        find=True
    elif A[0]==n:
        find=True
    else:
        while find==False and start<end-1:
            middle=(start+end)//2
            if n>A[middle]:
                start=middle
            elif n<A[middle]:
                end=middle
            else:
                find=True
    return find

for n in range(N):
    if S[n]=="R":
        R.append(n)
    elif S[n]=="G":
        G.append(n)
    else:
        B.append(n)

EVERY=len(R)*len(G)*len(B)

REMOVE=0
for r in R:
    for g in G:
        if (r+g)%2==0:
            candidate=[2*r-g,(r+g)//2,2*g-r]
        else:
            candidate=[2*r-g,2*g-r]
        
        for e in candidate:
            #if binary_search(B,e)==True:
            if e in B:
                REMOVE+=1

print(EVERY-REMOVE)

### FIXED CODE ###

N=int(input())
S=input()
R=[]
G=[]
B=[]

for n in range(N):
    if S[n]=="R":
        R.append(n)
    elif S[n]=="G":
        G.append(n)
    else:
        B.append(n)

ANS=len(R)*len(G)*len(B)

for i in range(N-2):
    for j in range(i+1,N-1):
        k=2*j-i
        if k<N and S[i]!=S[j] and S[j]!=S[k] and S[k]!=S[i]:
            ANS-=1


print(ANS)
### BUGGY CODE ###

import math
def modpow(a,b,MOD):#a**b(MOD)
    if b == 0:
        return 1
    if b%2:
        return a*modpow(a**2%MOD,b//2,MOD)%MOD
    else:
        return modpow(a**2%MOD,b//2,MOD)
MOD=998244353
n=int(input())
l=list(map(int,input().split()))
if l[0]!=0:
    print(0)
    exit()
else:
    l=l[1:]
if 0 in l:
    print(0)
    exit()
ans=1
tmp=1
for i in range(1,max(l)+1):
    c=l.count(i)
    if c==0:
        print(0)
        exit()
    ans*=modpow(tmp,c,MOD)
    ans%=MOD
    tmp=c
print(ans)

### FIXED CODE ###

import math
import collections
def modpow(a,b,MOD):#a**b(MOD)
    if b == 0:
        return 1
    if b%2:
        return a*modpow(a**2%MOD,b//2,MOD)%MOD
    else:
        return modpow(a**2%MOD,b//2,MOD)
MOD=998244353
n=int(input())
l=list(map(int,input().split()))
if l[0]!=0:
    print(0)
    exit()
else:
    l=l[1:]
if 0 in l:
    print(0)
    exit()
cl=collections.Counter(l)
ans=1
tmp=1
for i in range(1,max(l)+1):
    c=cl[i]
    if c==0:
        print(0)
        exit()
    ans*=modpow(tmp,c,MOD)
    ans%=MOD
    tmp=c
print(ans)
### BUGGY CODE ###

import copy
a,b=map(int,input().split())
c=[list(map(int,input().split())) for i in range(b)]
s,t=map(int,input().split())
dd=[[]for i in range(a+1)]
for i in range(b):
  da=c[i][0]
  db=c[i][1]
  dd[da].append(db)
  
d=[[]for i in range(a+1)]
for i in range(a+1):
  for j in dd[i]:
    for k in dd[j]:
      for l in dd[k]:
        d[i].append(l)
e=[s]
f=[s]
h=0
for i in range(1,a+1):
  g=[]
  for j in f:
    for k in d[j]:
      if k not in e:
        e.append(k)
        g.append(k)
  if g==[]:
    print(-1)
    break
  for j in g:
    if j==t:
      print(i)
      h=1
      break
  if h==1:
    break
  f=copy.copy(g)

### FIXED CODE ###

import copy
a,b=map(int,input().split())
c=[list(map(int,input().split())) for i in range(b)]
s,t=map(int,input().split())
s=3*s
t=3*t
dd=[[]for i in range(a+1)]
for i in range(b):
  da=c[i][0]
  db=c[i][1]
  dd[da].append(db)
  

d=[[]for i in range(3*(a+1))]
for i in range(len(dd)):
  for j in dd[i]:
      d[3*i].append(3*j+1)
      d[3*i+1].append(3*j+2)
      d[3*i+2].append(3*j)
e=[-1 for i in range(3*a+3)]
f=[s]
h=0
for i in range(1,3*a+3):
  g=[]
  for j in f:
    for k in d[j]:
      if e[k]==-1:
        e[k]=1
        g.append(k)
        if k==t:
          print(i//3)
          h=1
          break
    if h==1:
      break
  if h==1:
    break
  if g==[]:
    print(-1)
    break
  f=copy.copy(g)
### BUGGY CODE ###

from math import ceil
x=int(input())
i=0
ok=True
if x<=2:
  print(2)
elif x==3:
  print(3)
elif x==4:
  print(5)
else:
  while 1:
    n=ceil((x+i)**0.5)
    for j in range(2,n):
      if (x+i)%j==0:
        ok=False
    if ok:
      print(x+i)
      exit()
    i+=1


### FIXED CODE ###

from math import ceil
x=int(input())
i=0
if x<=2:
  print(2)
elif x==3:
  print(3)
elif x==4:
  print(5)
else:
  while 1:
    ok=True
    n=ceil((x+i)**0.5)
    for j in range(2,n):
      if (x+i)%j==0:
        ok=False
        break
    if ok:
      print(x+i)
      exit()
    i+=1
### BUGGY CODE ###

#!/usr/bin/python
# coding: UTF-8


#import scipy.optimize
import math

    
##################################################################

if __name__ == "__main__":

    Input = [input() for i in range(2)]
    N,M = list(map(int,Input[0].split()))
    A = list(map(int,Input[1].split()))
    A.sort(reverse=True)

    if N==1:
        Money = math.floor(A[0]/(2**M))
        print(Money)
    else:      
        Use = 0
        while Use < M:
            if A[0] == A[1]:
                Usenow = 1
                Use += Usenow
            else:
                Usenow = math.ceil(math.log2(A[0])-math.log2(A[1]))
                Use += Usenow
                if Use > M:
                    Usenow -= Use - M
                    Use = M
            temp = math.floor(A[0]/(2**Usenow))
            if temp >= A[1]:
                A[0] = temp
            else:
                for i in range(2,N):
                    if temp >= A[i]:
                        A[0:i-1] = A[1:i]
                        A[i-1] = temp
                        break
                    elif i == N-1:
                        A[0:N-1] = A[1:N]
                        A[N-1] = temp                        
                    else:
                        continue
        print(sum(A))                            


### FIXED CODE ###

# coding: UTF-8

#import scipy.optimize
from math import ceil,floor
from heapq import heappush, heappop, heapify
    
##################################################################

if __name__ == "__main__":

    Input = [input() for i in range(2)]
    N,M = list(map(int,Input[0].split()))
    A = list(map(int,Input[1].split()))
    A = [-a for a in A]
    heapify(A)
    Use = 0
    while Use < M:
        temp = -1*heappop(A)
        temp = floor(temp/2)
        heappush(A, -temp)
        Use += 1
    print(sum(A)*-1)
### BUGGY CODE ###

N = int(input())
A = tuple(map(lambda n: int(n) - 1, input().split()))

minlen = 10**9
for k in range(N, 0, -1):
    # kは残す数
    A_ = A[:]
    for j in range(k):
        if j in A_:
            nf = A_.index(j)
            A_ = A_[nf:]
        else:
            break
    else:
        minlen = min(minlen, N - k)
        break

if minlen >= N:
    print(-1)
else:
    print(minlen)


### FIXED CODE ###

N = int(input())
A = tuple(map(lambda n: int(n) - 1, input().split()))

rem = 0
bk = 0
for a in A:
    if a == rem:
        rem += 1
    else:
        bk += 1

if bk == N:
    print(-1)
else:
    print(bk)
### BUGGY CODE ###

import math

def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

n=int(input())
a=list(map(int,input().split()))
cnt={}
comb={}
ans=0
for i in a:
    if i in cnt:
        cnt[i]+=1
    else:
        cnt[i]=1
        
for i in cnt.values():
    if i<2:
        continue
    if not i in comb:
        comb[i]=combinations_count(i,2)
    ans+=comb[i]

for i in range(n):
    pans=ans
    if cnt[a[i]] in comb:
        pans-=comb[cnt[a[i]]]
    c=cnt[a[i]]-1
    if c>1:
        if not c in comb:
            comb[c]=combinations_count(c,2)
        pans+=comb[c]
    print(pans)


### FIXED CODE ###

import math

def combinations_count(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result

n=int(input())
a=list(map(int,input().split()))
cnt={}
comb={}
ans=0
for i in a:
    if i in cnt:
        cnt[i]+=1
    else:
        cnt[i]=1
        
for i in cnt.values():
    if i<2:
        continue
    if not i in comb:
        comb[i]=combinations_count(i,2)
    ans+=comb[i]

for i in range(n):
    pans=ans
    if cnt[a[i]] in comb:
        pans-=comb[cnt[a[i]]]
    c=cnt[a[i]]-1
    if c>1:
        if not c in comb:
            comb[c]=combinations_count(c,2)
        pans+=comb[c]
    print(pans)
### BUGGY CODE ###

n = int(input())
l = list(map(int, input().split()))
c = 0
while all(i % 2 == 0 for i in l):
    a = [i/2 for i in l]
    c += 1
print(c)

### FIXED CODE ###

N = int(input())
a = list(map(int, input().split()))
cnt = 0
while all(i % 2 == 0 for i in a):
    a = [i/2 for i in a]
    cnt += 1
print(cnt)
### BUGGY CODE ###

black = "B"
white = "W"

def main():
    s = [c for c in input()]
    ans = one(s)
    tmp = ans
    while tmp != 0:
        tmp = one(s)
        ans += tmp
    print(ans) 

def one(s):
    ans = 0
    for i in range(len(s) - 1):
        if s[i] == black and s[i+1] == white:
            s[i], s[i+1] = s[i+1], s[i]
            ans += 1
    return ans

main()


### FIXED CODE ###

black = "B"
white = "W"

def move_cost(s):
    a = 0
    count = 0
    for i, c in enumerate(s):
        if c == white:
            a += i
            count += 1
    count -= 1
    return a - count*(count+1)//2


print(move_cost(input()))
### BUGGY CODE ###

from bisect import bisect_right


def main():
    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
    for a in A:
        i = bisect_right(B, a)
        B_ = B[i:]

        for b in B_:
            i = bisect_right(C, b)
            c_num = len(C) - i
            count += c_num

    print(count)


if __name__ == "__main__":
    main()


### FIXED CODE ###

from bisect import bisect_right
from itertools import accumulate

def main():
    n = int(input())
    A = sorted(list(map(int, input().split())))
    B = sorted(list(map(int, input().split())))
    C = sorted(list(map(int, input().split())))

    B_counts = []
    for b in B:
        i = bisect_right(C, b)
        B_counts.append(len(C) - i)
    B_counts_cumsum = list(accumulate(B_counts))
    B_counts_cumsum.insert(0, 0)

    count = 0
    for a in A:
        i = bisect_right(B, a)
        if i == len(B):
            continue
        count += B_counts_cumsum[-1] - B_counts_cumsum[i]

    print(count)


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

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

e = lambda p: (1+p)/2 #期待値

#期待値の配列
exp=[e(p[0])]
for i in range(1,n):
    tmp=exp[i-1]+e(p[i])
    exp.append(tmp)
    
#累積和
subsum=[]
for i in range(n-k+1):
    subsum.append(sum(p[i:k+i]))
    
#累積和の最大値のインデックス
idx = subsum.index(max(subsum))

if idx==0: print(exp[k-1])
else: print(exp[(idx-1)+k]-exp[(idx-1)])

### FIXED CODE ###

n,k=map(int,input().split())
p=list(map(int,input().split()))
s=[0]*(n+1)
for i in range(n):
    s[i+1]=s[i]+p[i]
res=0
for i in range(n-k+1):
    res=max(res,s[i+k]-s[i])
print((res+k)/2)
### BUGGY CODE ###


N=input()
cnt=0
bit=0
bitflag=0
cur=0
inf=1001001001

Nd="".join(("0",N))


dp=[[inf for _ in range(2)] for _ in range(1000005)]
dp[0][0]=0
print(dp)
for i in range(0,len(Nd),1):
    for j in range(2):
        x=int(Nd[len(Nd)-1-i])
        #print(x)
        x=x+j
        for a in range(0,10,1):
            ni=i+1
            nj=0
            b=a-x
            if b<0:
                nj=1
                b=b+10
            dp[ni][nj]=min(dp[ni][nj],dp[i][j]+a+b)

print(dp[len(Nd)][0])






### FIXED CODE ###


N=input()
cnt=0
bit=0
bitflag=0
cur=0
inf=float("inf")

Nd="".join(("0",N))


dp=[[inf for _ in range(2)] for _ in range(1000005)]
dp[0][0]=0
#print(dp)
for i in range(0,len(Nd),1):
    for j in range(2):
        x=int(Nd[len(Nd)-1-i])
        #print(x)
        x=x+j
        for a in range(0,10,1):
            ni=i+1
            nj=0
            b=a-x
            if b<0:
                nj=1
                b=b+10
            dp[ni][nj]=min(dp[ni][nj],dp[i][j]+a+b)

print(dp[len(Nd)][0])
### BUGGY CODE ###

import sys
from collections import deque,defaultdict

I=sys.stdin.readline

def ii():
	return int(I().strip())
def li():
	return list(map(int,I().strip().split()))

def mi():
	return map(int,I().strip().split())


def main():
	n,k=mi()
	arr=li()
	k_mul=1
	for i in range(k):
		k_mul*=arr[i]
	x=0
	for i in range(n-k):
		tmp=(k_mul//arr[x])*arr[k+i]
		if tmp>k_mul:
			print("Yes")
		else:
			print("No")
		k_mul=tmp
		x+=1








		


		










		






if __name__ == '__main__':
	main()

### FIXED CODE ###

import sys
from collections import deque,defaultdict

I=sys.stdin.readline

def ii():
	return int(I().strip())
def li():
	return list(map(int,I().strip().split()))

def mi():
	return map(int,I().strip().split())


def main():
	ans=""
	n,k=mi()
	arr=li()
	a=0
	for i in range(n-k):
		tmp=arr[k+i]
		if tmp>arr[a]:
			ans+="Yes\n"
		else:
			ans+="No\n"
		a+=1
	print(ans)








		


		










		






if __name__ == '__main__':
	main()