Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
N, X = map(int, input().split()))

for i in range(min(N, X // 10*4) + 1):
  for j in range(min(N-i, (X-10*4*i) // 5000) + 1):
    if (X - 10*4*i - 5000*j) // 1000 == N - i - j:
      print(i,j,N-i-j)
      break
else:
  print(-1,-1,-1)


Fixed submission:
N, X = map(int, input().split())

flag = False
result = [-1,-1,-1]
for i in range(min(N, X // 10**4) + 1):
  for j in range(min(N-i, (X-10**4*i) // 5000) + 1):
    if (X - 10**4*i - 5000*j) // 1000 == N - i - j:
      result = (i,j,N-i-j)
      flag = True
      break
  if flag:
    break
print(*result)
Buggy python submission (verdict: Runtime Error):
import math
A,B = map(int, input().split())
print(math.ceil((a+b)/2))

Fixed submission:
import math
A,B = map(int, input().split())
print(math.ceil((A+B)/2))
Buggy python submission (verdict: Runtime Error):
from collections import Counter
N, K = map(int, input().split())
A = list(map(int, input().split()))
dA = Counter(A)
if len(dA) - K <= 0:
  print(0)
  exit()
print(sum(sorted(dA.values())[:len(dA)-K])))

Fixed submission:
from collections import Counter
N, K = map(int, input().split())
A = list(map(int, input().split()))
dA = Counter(A)
if len(dA) - K <= 0:
  print(0)
  exit()
print(sum(sorted(dA.values())[:len(dA)-K] ))
Buggy python submission (verdict: Runtime Error):
s = [int(i) for i in input()]
op = {'+':1, '-':-1}
for a in op:
  for b in op:
    for c in op:
      if s[0] + op['a'] * s[1] + op['b'] * s[2] + op['c'] * s[3] == 7:
        print(str(s[0]) + op['a'] + str(s[1]) + op['b'] + str(s[2]) + op['c'] + str(s[3]) + '=7')

Fixed submission:
def main():
    s = [int(i) for i in input()]
    op = {'+':1, '-':-1}
    for a in op:
        for b in op:
            for c in op:
                if s[0] + op[a] * s[1] + op[b] * s[2] + op[c] * s[3] == 7:
                    return (str(s[0]) + a + str(s[1]) + b + str(s[2]) + c + str(s[3]) + '=7')

        
if __name__ == '__main__':
    print(main())
Buggy python submission (verdict: Runtime Error):
n,z,w= map(int, input().split())
a = list(map(int, input().split())
print(max(abs(a[-1] - w), abs(a[-2] - a[-1]) if n > 1 else 0))

Fixed submission:
n,z,w= map(int, input().split())
a = list(map(int, input().split()))
print( max(abs(a[-1] - w), abs(a[-2] - a[-1]) if n > 1 else 0))
Buggy python submission (verdict: Runtime Error):
from collections import deque

def dfs(graph, start, goal):
    stack = deque()
    push, pop = stack.append, stack.pop
    push(start)
    visited = [False for i in range(N)]
    visited[start] = True
    
    while stack:
        a = pop()
        for b in graph[a].keys():
            if a in [start, goal] and b in [start, goal]:
                continue
            elif b == goal:
                return True
            elif not visited[b]:
                push(b)
                visited[b] = True
    return False

N,M = map(int, input().split())
graph = {}
bridge = []
for i in range(M):
    a,b = map(int, input().split())
    if a not in graph:
        graph[a] = {}
    if b not in graph:
        graph[b] = {}
    graph[a][b] = graph[b][a] = 1
    bridge.append([a,b])

ans = 0
for a,b in bridge:
    ans += not dfs(graph, a, b)
print(ans)

Fixed submission:
from collections import deque

def dfs(graph, start, goal):
    stack = deque()
    push, pop = stack.append, stack.pop
    push(start)
    visited = [False for i in range(N+1)]
    visited[start] = True
    
    while stack:
        a = pop()
        for b in graph[a].keys():
            if a in [start, goal] and b in [start, goal]:
                continue
            elif b == goal:
                return True
            elif not visited[b]:
                push(b)
                visited[b] = True
    return False

N,M = map(int, input().split())
graph = {}
bridge = []
for i in range(M):
    a,b = map(int, input().split())
    if a not in graph:
        graph[a] = {}
    if b not in graph:
        graph[b] = {}
    graph[a][b] = graph[b][a] = 1
    bridge.append([a,b])

ans = 0
for a,b in bridge:
    ans += not dfs(graph, a, b)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):

def resolve():
    nnn = int(input())
    for h in range(1, 3501):
        for w in range(1, 3501):
            div = 4 * h * w - nnn * h - nnn * w
            if div == 0:
                continue
            n = nnn * h * w / div
            if int(n) == n and 0 < n:
                print(h, w, int(n))
                return

if __name__ == "__main__":
    resolve()


Fixed submission:
N = int(input())

for i in range(1,3500):
    for j in range(1,3500):
        if 4 * i * j - N * i - N * j == 0:
            continue
        k = N * i * j / (4 * i * j - N * i - N * j)
        if k > 0 and k == int(k):
            print(i, j, int(k))
            exit()
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
for h in range(1,3500+1):
    for n in range(1,3500+1):
        if 4 * n * h - N * h - N * n == 0:
            continue
        w = N * h * n / (4 * n * h - N * n - N * h)
        if w > 0 and int(w) == w:
            print(h,n,int(w))
            exit()

Fixed submission:
N = int(input())
for h in range(1,3500+1):
    for n in range(1,3500+1):
        if 4 * n * h - N * h - N * n == 0:
            continue
        w = N * h * n / (4 * n * h - N * n - N * h)
        if w > 0 and int(w) == w:
            print(h,n,int(w))
            exit()
Buggy python submission (verdict: Runtime Error):
x,t = map(int,input().split())
print(max(0, x=t))

Fixed submission:
x,t = map(int,input().split())
print(max(0, x-t))
Buggy python submission (verdict: Runtime Error):
n = int(input())
ans = 0
for i,p in enumerate(map(int,input().split())):
  if i + 1 == p:
    ans += 1
print(max(ans-1), 0)

Fixed submission:
from math import ceil

n = int(input())
ans = 0
tmp = 0
for i,p in enumerate(map(int,input().split())):
    if i + 1 == p:
        tmp += 1
    elif tmp:
        ans += ceil(tmp / 2)
        tmp = 0
print(ans + ceil(tmp / 2))
Buggy python submission (verdict: Runtime Error):
x,a,b = map(int,input().split())
print(min(abs(x-a, x-b))

Fixed submission:
x,a,b = map(int,input().split())
print('A' if abs(x-a) < abs(x-b) else 'B')

Buggy python submission (verdict: Runtime Error):
x,a,b = map(int,input().split())
print(min(abs(x-a, x-b)))

Fixed submission:
x,a,b = map(int,input().split())
print('A' if abs(x-a) < abs(x-b) else 'B')
Buggy python submission (verdict: Runtime Error):
n = int(input())
s1 = input()
s2 = input()
mod = 10**9+7
dp = [-1] * (n)
if s1[0] == s2[0]:
    dp[0] = 1 
else:
    dp[0] = 2
for i in range(n-1):
    if dp[i] == -1:
        continue
    if s1[i] == s2[i]:
        dp[i+1] = (dp[i] * 2) % mod
        continue
    if i+2 > n:
        continue
    if s1[i+2] == s2[i+2]:
        dp[i+2] = dp[i]
    else:
        dp[i+2] = (dp[i] * 3) % mod

ans = dp[-1] if dp[-1] != -1 else dp[-2]
print((ans * 3) % mod)
# print(dp)

Fixed submission:
n = int(input())
s1 = input()
s2 = input()
mod = 10**9+7
dp = [-1] * (n)
if s1[0] == s2[0]:
    dp[0] = 1 
else:
    dp[0] = 2
for i in range(n-1):
    if dp[i] == -1:
        continue
    if s1[i] == s2[i]:
        dp[i+1] = (dp[i] * 2) % mod
        continue
    if i+2 >= n:
        break
    if s1[i+2] == s2[i+2]:
        dp[i+2] = dp[i]
    else:
        dp[i+2] = (dp[i] * 3) % mod

ans = dp[-1] if dp[-1] != -1 else dp[-2]
print((ans * 3) % mod)
# print(dp)
Buggy python submission (verdict: Runtime Error):
a,b= map(input().split())
print((a-1)*(b-1))

Fixed submission:
a,b= map(int,input().split())
print((a-1)*(b-1))
Buggy python submission (verdict: Time Limit Exceeded):
from collections import deque

def dfs(graph, start, goal):
    stack = deque()
    push, pop = stack.append, stack.pop
    route = [[] for i in range(N+1)]
    push([start, []])
    route[start] = [start]
    while stack:
        a, r = pop()
        for b in graph[a].keys():
            if route[b] == []:
                push([b, r+[b]])
                route[b] = r+[b]
    return route

N = int(input())
graph = {}
for i in range(N-1):
    a,b = map(int, input().split())
    if a not in graph:
        graph[a] = {}
    if b not in graph:
        graph[b] = {}
    graph[a][b] = graph[b][a] = 1
route = dfs(graph, 1, N)
# print(route)
q_len = len(route[N])
q = route[N][q_len // 2]
nex = route[N][q_len // 2]
tmp = [r for r in route if nex in r]
s_get = len(tmp)
# print(s_get, nex, N-s_get)
print('Fennec' if N - s_get > s_get else 'Snuke')

Fixed submission:
from collections import deque

def dfs(graph, start, goal):
    s_stack = deque()
    g_stack = deque()
    visited = [0 for i in range(N+1)]
    s_stack.append([start,0])
    g_stack.append([goal, 0])
    visited[start] = 1 
    visited[goal] = 1 
    s_cnt = 1
    g_cnt = 1
    round = 0
    while s_stack or g_stack:
        while s_stack:
            a,cost = s_stack.popleft()
            if cost > round:
                s_stack.appendleft([a,cost])
                break
            for b in graph[a].keys():
                if not visited[b]:
                    s_stack.append([b,cost+1])
                    visited[b] += 1 
                    s_cnt += 1
        while g_stack:
            a, cost = g_stack.popleft()
            if cost > round:
                g_stack.appendleft([a,cost])
                break
            for b in graph[a].keys():
                if not visited[b]:
                    g_stack.append([b,cost+1])
                    visited[b] += 1 
                    g_cnt += 1
        round += 1
    # print(s_cnt, g_cnt)
    return s_cnt > g_cnt

N = int(input())
graph = {}
for i in range(N-1):
    a,b = map(int, input().split())
    if a not in graph:
        graph[a] = {}
    if b not in graph:
        graph[b] = {}
    graph[a][b] = graph[b][a] = 1
print('Fennec' if dfs(graph,1,N) else 'Snuke')
Buggy python submission (verdict: Runtime Error):
N = input()
A = list(map(int, input().split()))
A.sort()
pritn(A[-1] - A[0])

Fixed submission:
N = input()
A = list(map(int, input().split()))
A.sort()
print(A[-1] - A[0])
Buggy python submission (verdict: Runtime Error):
n = int(input())
ten = []
notten = []
for _ in range(n):
  s = int(input())
  if s % 10:
    notten.append(s)
  else:
    ten.append(s)
ans = sum(notten) + sum(ten)
if sum(notten) % 10 == 0:
  print(ans - min(notten))
elif ans % 10 == 0:
  print(0)
else:
  print(ans)
  

Fixed submission:
n = int(input())
ten = []
notten = []
for _ in range(n):
  s = int(input())
  if s % 10:
    notten.append(s)
  else:
    ten.append(s)
ans = sum(notten) + sum(ten)
if notten and sum(notten) % 10 == 0:
  print(ans - min(notten))
elif ans % 10 == 0:
  print(0)
else:
  print(ans)
Buggy python submission (verdict: Runtime Error):
h,w = map(int,input().split())
edges = '#' * (W+2)
ans = [edges]
for i in range(h):
  ans.append('#' + input() + '#')
ans.append(edges)
[print(i) for i in ans]

Fixed submission:
h,w = map(int,input().split())
edges = '#' * (w+2)
ans = [edges]
for i in range(h):
  ans.append('#' + input() + '#')
ans.append(edges)
[print(i) for i in ans]
Buggy python submission (verdict: Runtime Error):
A,B,C = map(int, input().split())
print('YES' if A[-1] == B[0] and B[-1] == C[0] and C[-1] == A[0] else 'NO')

Fixed submission:
A,B,C = input().split()
print('YES' if A[-1] == B[0] and B[-1] == C[0] else 'NO')
Buggy python submission (verdict: Runtime Error):
print(''.join([o+e for o,e in zip(input(), input()+[''])]))

Fixed submission:
print(''.join([o+e for o,e in zip(input(), input()+'\n')]))
Buggy python submission (verdict: Runtime Error):
import numpy as np
N,M = map(int, input().split())
A = []
for i in range(N):
    A.append(input())
B = []
for i in range(M):
    M.append(input())
A = np.array(A)
B = np.array(B)

for i in range(N-M):
    for j in range(N-M):
        if A[i:i+M][j:j+M] == B:
            print('Yes')
            exit()
print('No')

Fixed submission:
N,M = map(int, input().split())
A = []
for i in range(N):
    A.append(input())
B = []
for i in range(M):
    B.append(input())

for i in range(N-M+1):
    for j in range(N-M+1):
        tmp = [A[i+k][j:j+M] for k in range(M)]
        if tmp == B:
            print('Yes')
            exit()
print('No')

Buggy python submission (verdict: Runtime Error):
import numpy as np
N,M = map(int, input().split())
A = []
for i in range(N):
    A.append(input())
B = []
for i in range(M):
    M.append(input())
A = np.array(A)
B = np.array(B)

for i in range(N-M):
    for j in range(N-M):
        if A[i:i+M, j:j+M] == B:
            print('Yes')
            exit()
print('No')

Fixed submission:
N,M = map(int, input().split())
A = []
for i in range(N):
    A.append(input())
B = []
for i in range(M):
    B.append(input())

for i in range(N-M+1):
    for j in range(N-M+1):
        tmp = [A[i+k][j:j+M] for k in range(M)]
        if tmp == B:
            print('Yes')
            exit()
print('No')
Buggy python submission (verdict: Runtime Error):
x,op,y = int,input().split()
x = int(x)
y = int(y)
print(x+y if op == '+' else x-y)


Fixed submission:
x,op,y = input().split()
x = int(x)
y = int(y)
print(x+y if op == '+' else x-y)
Buggy python submission (verdict: Runtime Error):
s = input()
print('Second' if len(s) % 2 == 0 ^ s[0] != s[-1] else 'First')


Fixed submission:
s = input()
print('Second' if (len(s) % 2 == 0) ^ (s[0] == s[-1]) else 'First')
Buggy python submission (verdict: Runtime Error):
h,w = map(int , input().split())
alf = 'ABCDEFGHIJKLMN'
for i in range(h):
  for j,s in enumerate(input().split()):
    if s == 'snuke':
      print(alf[j] + str(i+1))

Fixed submission:
h,w = map(int , input().split())
alf = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
for i in range(h):
  for j,s in enumerate(input().split()):
    if s == 'snuke':
      print(alf[j] + str(i+1))
Buggy python submission (verdict: Runtime Error):
dire = [0,0,0,0]
d = {c:i for i,c in numerate('WENS')}
for c in input():
	dire[d[c]] = 1
print('No' if (dire[0] ^ dire[1]) or (dire[2] ^ dire[3]) else 'Yes')

Fixed submission:
dire = [0,0,0,0]
d = {c:i for i,c in enumerate('WENS')}
for c in input():
	dire[d[c]] = 1
print('No' if (dire[0] ^ dire[1]) or (dire[2] ^ dire[3]) else 'Yes')
Buggy python submission (verdict: Runtime Error):
num = input()
num_list = list(map(int, input().split()))sort()
i = 0
sum = 0
while i < num * 2:
  sum += num_list[i]
  i += 2
print(sum)

Fixed submission:
num = int(input())
num_list = sorted(list(map(int, input().split())))
i = 0
sum = 0
while i < num * 2:
  sum += num_list[i]
  i += 2
print(sum)
Buggy python submission (verdict: Runtime Error):
import sys
import re
import random
import math
import copy
from heapq import heappush, heappop, heapify
from functools import cmp_to_key
from bisect import bisect_left, bisect_right
from collections import defaultdict, deque, Counter
# sys.setrecursionlimit(1000000)

# input aliases
input = sys.stdin.readline
getS = lambda: input().strip()
getN = lambda: int(input())
getList = lambda: list(map(int, input().split()))
getZList = lambda: [int(x) - 1 for x in input().split()]

INF = float("inf")
MOD = 10**9 + 7
divide = lambda x: pow(x, MOD-2, MOD)


def fact_and_inv(SIZE):
    inv = [0] * SIZE  # inv[j] = j^{-1} mod MOD
    fac = [0] * SIZE  # fac[j] = j! mod MOD
    finv = [0] * SIZE  # finv[j] = (j!)^{-1} mod MOD
    inv[1] = 1
    fac[0] = fac[1] = 1
    finv[0] = finv[1] = 1
    for i in range(2, SIZE):
        inv[i] = MOD - (MOD // i) * inv[MOD % i] % MOD
        fac[i] = fac[i - 1] * i % MOD
        finv[i] = finv[i - 1] * inv[i] % MOD

    return fac, finv

def solve():
    n = getN()

    fac, finv = fact_and_inv(n)

    length = 1
    ans = 0
    while True:
        if length * 3 > n:
            break
        distribution = n - length * 3
        ans += fac[length + distribution - 1] * finv[length-1] * finv[distribution]
        ans %= MOD
        length += 1
    print(ans)


def main():
    n = getN()
    for _ in range(n):
        solve()

    return
if __name__ == "__main__":
    # main()
    solve()

Fixed submission:
import sys
import re
import random
import math
import copy
from heapq import heappush, heappop, heapify
from functools import cmp_to_key
from bisect import bisect_left, bisect_right
from collections import defaultdict, deque, Counter
# sys.setrecursionlimit(1000000)

# input aliases
input = sys.stdin.readline
getS = lambda: input().strip()
getN = lambda: int(input())
getList = lambda: list(map(int, input().split()))
getZList = lambda: [int(x) - 1 for x in input().split()]

INF = float("inf")
MOD = 10**9 + 7
divide = lambda x: pow(x, MOD-2, MOD)


def fact_and_inv(SIZE):
    inv = [0] * SIZE  # inv[j] = j^{-1} mod MOD
    fac = [0] * SIZE  # fac[j] = j! mod MOD
    finv = [0] * SIZE  # finv[j] = (j!)^{-1} mod MOD
    inv[1] = 1
    fac[0] = fac[1] = 1
    finv[0] = finv[1] = 1
    for i in range(2, SIZE):
        inv[i] = MOD - (MOD // i) * inv[MOD % i] % MOD
        fac[i] = fac[i - 1] * i % MOD
        finv[i] = finv[i - 1] * inv[i] % MOD

    return fac, finv

def solve():
    n = getN()

    fac, finv = fact_and_inv(n+2000)

    length = 1
    ans = 0
    while True:
        if length * 3 > n:
            break
        distribution = n - length * 3
        ans += fac[length + distribution - 1] * finv[length-1] * finv[distribution]
        ans %= MOD
        length += 1
    print(ans)


def main():
    n = getN()
    for _ in range(n):
        solve()

    return
if __name__ == "__main__":
    # main()
    solve()
Buggy python submission (verdict: Runtime Error):
import sys
from collections import defaultdict, deque, Counter
import math

# import copy
from bisect import bisect_left, bisect_right
# import heapq

# sys.setrecursionlimit(1000000)

# input aliases
input = sys.stdin.readline

getS = lambda: input().strip()
getN = lambda: int(input())
getList = lambda: list(map(int, input().split()))
getZList = lambda: [int(x) - 1 for x in input().split()]

INF = 10 ** 20
MOD = 10**9 + 7
divide = lambda x: pow(x, MOD-2, MOD)


def nck(n, k, kaijyo):
    return (npk(n, k, kaijyo) * divide(kaijyo[k])) % MOD


def npk(n, k, kaijyo):
    if k == 0 or k == n:
        return n % MOD
    return (kaijyo[n] * divide(kaijyo[n-k])) % MOD


def kaijyo(n):
    ret = [1]
    for i in range(1, n + 1):
        ret.append((ret[-1] * i)% MOD)
    return ret

def judge(anums, k, mid):
    tmp = 0
    for anum in anums:
        tt = anum // mid
        if mid * tt != anum:
            tt += 1
        tmp += tt - 1

    if tmp <= k:
        return True
    else:
        return False

def solve():
    n, k = getList()
    anums = getList()

    mn = 0
    mx = sum(anums) + 1
    while(mx - mn > 1):
        mid = (mn + mx) // 2
        if judge(anums, k, mid):
            mx = mid
        else:
            mn = mid

    if judge(anums, k, mn):
        print(mn)
    else:
        print(mx)


def main():
    n = getN()
    for _ in range(n):
        solve()


if __name__ == "__main__":
    # main()
    solve()

Fixed submission:
import sys
from collections import defaultdict, deque, Counter
import math

# import copy
from bisect import bisect_left, bisect_right
# import heapq

sys.setrecursionlimit(1000000)

# input aliases
input = sys.stdin.readline

getS = lambda: input().strip()
getN = lambda: int(input())
getList = lambda: list(map(int, input().split()))
getZList = lambda: [int(x) - 1 for x in input().split()]

INF = 10 ** 20
MOD = 10**9 + 7
divide = lambda x: pow(x, MOD-2, MOD)


def nck(n, k, kaijyo):
    return (npk(n, k, kaijyo) * divide(kaijyo[k])) % MOD


def npk(n, k, kaijyo):
    if k == 0 or k == n:
        return n % MOD
    return (kaijyo[n] * divide(kaijyo[n-k])) % MOD


def kaijyo(n):
    ret = [1]
    for i in range(1, n + 1):
        ret.append((ret[-1] * i)% MOD)
    return ret

def judge(anums, k, mid):
    if mid == 0:
        return False
    tmp = 0
    for anum in anums:
        tt = anum // mid
        if mid * tt != anum:
            tt += 1
        tmp += tt - 1

    if tmp <= k:
        return True
    else:
        return False

def solve():
    n, k = getList()
    anums = getList()

    mn = 0
    mx = sum(anums) + 1
    while(mx - mn > 1):
        mid = (mn + mx) // 2
        if judge(anums, k, mid):
            mx = mid
        else:
            mn = mid

    if judge(anums, k, mn):
        print(mn)
    else:
        print(mx)


def main():
    n = getN()
    for _ in range(n):
        solve()


if __name__ == "__main__":
    # main()
    solve()
Buggy python submission (verdict: Time Limit Exceeded):
import sys
from collections import defaultdict, deque, Counter
import math

# import copy
from bisect import bisect_left, bisect_right
import heapq

# sys.setrecursionlimit(1000000)

# input aliases
input = sys.stdin.readline

getS = lambda: input().strip()
getN = lambda: int(input())
getList = lambda: list(map(int, input().split()))
getZList = lambda: [int(x) - 1 for x in input().split()]

INF = 10 ** 20
MOD = 10**9 + 7
divide = lambda x: pow(x, MOD-2, MOD)


def nck(n, k, kaijyo):
    return (npk(n, k, kaijyo) * divide(kaijyo[k])) % MOD


def npk(n, k, kaijyo):
    if k == 0 or k == n:
        return n % MOD
    return (kaijyo[n] * divide(kaijyo[n-k])) % MOD


def kaijyo(n):
    ret = [1]
    for i in range(1, n + 1):
        ret.append((ret[-1] * i)% MOD)
    return ret

def solve():
    n, k = getList()
    nums = getList()
    pro = [1]
    for num in nums:
        pro.append(pro[-1] * num)
    # print(pro)
    for i in range(n - k):
        # print(i)
        ku = pro[k+i] / pro[i]
        ku2 = pro[k+i + 1] / pro[i+ 1]
        if ku2 > ku:
            print("Yes")
        else:
            print("No")
if __name__ == "__main__":
    # main()
    solve()

Fixed submission:
import sys
from collections import defaultdict, deque, Counter
import math

# import copy
from bisect import bisect_left, bisect_right
import heapq

# sys.setrecursionlimit(1000000)

# input aliases
input = sys.stdin.readline

getS = lambda: input().strip()
getN = lambda: int(input())
getList = lambda: list(map(int, input().split()))
getZList = lambda: [int(x) - 1 for x in input().split()]

INF = 10 ** 20
MOD = 10**9 + 7
divide = lambda x: pow(x, MOD-2, MOD)


def nck(n, k, kaijyo):
    return (npk(n, k, kaijyo) * divide(kaijyo[k])) % MOD


def npk(n, k, kaijyo):
    if k == 0 or k == n:
        return n % MOD
    return (kaijyo[n] * divide(kaijyo[n-k])) % MOD


def kaijyo(n):
    ret = [1]
    for i in range(1, n + 1):
        ret.append((ret[-1] * i)% MOD)
    return ret

def solve():
    n, k = getList()
    nums = getList()
    # pro = [1]
    # for num in nums:
    #     pro.append(pro[-1] * num)
    # print(pro)
    for i in range(n - k):
        # print(i)
        # ku = pro[k+i] / p/] / pro[i+ 1]
        if nums[i] < nums[i+k]:
            print("Yes")
        else:
            print("No")
if __name__ == "__main__":
    # main()
    solve()