Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
s=input()

def walk(s):
  ls=len(s)
  if ls%2==1:
    print("NO")
    return
  nc=0
  sc=0
  wc=0
  ec=0
  for i in range(ls):
    if s[i]="W":
      wc+=1
    elif s[i]="E":
      ec+=1
    elif s[i]="N":
      nc+=1
    else:
      sc+=1
  if wc==ec and nc==sc:
    print("YES")
    return
  else:
    print("NO")
    return
walk(s)
    

Fixed submission:
s = input()


def walk(s):
    ls = len(s)
    nc = 0
    sc = 0
    wc = 0
    ec = 0
    l=[]
    for i in range(ls):
        if s[i] == "W":
            wc += 1
            l.append(wc)
        elif s[i] == "E":
            ec += 1
            l.append(ec)
        elif s[i] == "N":
            nc += 1
            l.append(nc)
        else:
            sc += 1
            l.append(sc)
    if (wc>0 and ec==0) or (wc==0 and ec>0) or (nc==0 and sc>0) or (nc>0 and sc==0):
        print("No")
        return
    
    else:
        print("Yes")
        return
walk(s)
Buggy python submission (verdict: Runtime Error):
import numpy as np

# Calculate intensity
N, K = [int(v) for v in input().split(" ")]
A_arr = np.array([int(v) for v in input().split(" ")])
step = np.arange(len(A_arr))
print("0")
exit()
def Luminate(A_arr, i):
  isLuminated = np.abs(step - i) < A_arr
  return isLuminated

def get_Intensity(A_arr):
  return np.array([np.sum(Luminate(A_arr, i)) for i in range(len(A_arr))])
Intensity = A_arr
for i in range(K):
  Intensity = get_Intensity(Intensity+1)
  if np.sum(Intensity) == N**2:
    break
print(" ".join([str(v) for v in Intensity]))


Fixed submission:
S = input()

nickname = S[0:3]
print(nickname)
Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
list_A=[]
for i in range(M):
    A = list(map(int, input().split()))
    list_A.append( A )

list_p = list(map(int, input().split()))

i = 0



list_func = []#スイッチ点灯の全組み合わせを入れる
cnt=0

def func(i):
    if (i == N):
        flag = True
        for k in range(M):
            sum = 0
            for j in list_A[k]:
                sum += j
            sum = sum - list_A[k][0]
            if sum %2 != list_p[k]:
                flag = False
        if flag == True:
            cnt+=1
        return
    list_func.append(1)
    func(i+1)
    list_func.pop(-1)

    list_func.append(0)
    func(i+1)
    list_func.pop(-1)

    return


func(0)
print (cnt)

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

list_p = list(map(int, input().split()))

i = 0



state = []#スイッチ点灯の全組み合わせを入れる
sum=0

def func(i):
    global sum
    if i == N:
        flag = True
        for i in range(M):
            cnt= 0
            for j in list_Connect[i]:
                cnt += state[j-1]
            if cnt %2 != list_p[i]:
                flag = False
                break
        if flag == True:
           sum+=1
    else:
        state.append(1)
        func(i+1)
        state.pop(-1)
        state.append(0)
        func(i+1)
        state.pop(-1)

    return


func(0)
print (sum)
Buggy python submission (verdict: Time Limit Exceeded):
from functools import reduce
from operator import mul

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

result = reduce(mul, a_list)

if result > 10 ** 18:
    print(-1)
else:
    print(result)

Fixed submission:
n = int(input())
a_list = list(map(int, input().split()))

if 0 in a_list:
    print(0)
else:
    result = 1
    for a in a_list:
        result = result * a
        if result > 10 ** 18:
            print(-1)
            break
    else:
        print(result)
Buggy python submission (verdict: Runtime Error):
from functools import reduce
from operator import mul

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

result = reduce(mul, a_list)

if result > 10 ** 18:
    print(-1)
else:
    print(result)


Fixed submission:
import math
from decimal import Decimal

a, b = list(input().split())

num = math.floor(Decimal(a) * Decimal(b))
print(num)
Buggy python submission (verdict: Runtime Error):
import math
 
def comb(n, r):
  return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

n = int(input())
a_list = list(map(int, input().split()))
a_list.append(n + 100)

for i in range(len(a_list) - 1):
  tmp_list = a_list[:]
  del tmp_list[i]
  tmp_list.sort()
  count = 0
  tmp_count = 0
  for j in range(1, len(tmp_list)):
    if tmp_list[j] == tmp_list[j - 1]:
      tmp_count += 1
    else:
      if tmp_count >= 1:
      	count += comb(tmp_count + 1, 2)
      tmp_count = 0
  print(count)
 

Fixed submission:
import math

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

nums = list(map(int, input().split()))

if nums[0] <= 1 and nums[1] <= 1:
  print(0)
elif nums[1] <= 1:
  print(comb(nums[0], 2))
elif nums[0] <= 1:
  print(comb(nums[1], 2))
else:
  print(comb(nums[0], 2) + comb(nums[1], 2))
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = [int(i) for i in input().split()]

while len(A) > 1:
  min_num = min(A)
  min_index = A.index(min(A))
  for i in range(len(A)):
    if i != min_index:
      A[i] = A[i] % min_num
      if(A[i] == 0):
        A.pop(i)


print(A[0])

Fixed submission:
N = int(input())
A = [int(i) for i in input().split()]

while len(A) > 1:
  min_num = min(A)
  min_index = A.index(min(A))
  for i in range(len(A)):
    if i != min_index:
      A[i] = A[i] % min_num

  while 0 in A:
    A.remove(0)

print(A[0])
Buggy python submission (verdict: Runtime Error):
x = input().split()
if x >= 30:
    print("Yes")
else:
    print("No")

Fixed submission:
x = int(input())
if x >= 30:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Time Limit Exceeded):
n,k,q = map(int,input().split())
a = [];
for i in range(q):
    a.append(int(input()))
for i in range(1,n+1):
    wp = a.count(i)
    if k-(q-wp) <= 0:
        print("No")
    else:
        print("Yes")

Fixed submission:
n,k,q = map(int,input().split())
a = []; b = [0]*n
for i in range(q):
    c = int(input())
    a.append(c)
    b[c-1] += 1
for i in b:
    if k-(q-i) <= 0:
        print("No")
    else:
        print("Yes")
Buggy python submission (verdict: Runtime Error):
n = int(input())
h = list(map(int,input().split()))
cnt = 0; res = []
for i in range(n-1):
    if h[i] >= h[i+1]:
        cnt += 1
    else:
        res.append(cnt)
        cnt = 0
    if i == n-2:
        res.append(cnt)
        break
print(max(res))

Fixed submission:
n = int(input())
h = list(map(int,input().split()))
cnt = 0; res = 0
for i in range(n-1):
    if h[i] >= h[i+1]:
        cnt += 1
    else:
        cnt = 0
    res = max(res,cnt)
print(res)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = []
for i in range(n):
    a.append(int(input()))
for i in range(n):
    if i == 0:
        ans = a[1:]
    if i == n:
        ans = a.pop(n)
    ans = a[:i] + a[i+1:]
    print(max(ans))

Fixed submission:
n = int(input())
a = []
for i in range(n):
    a.append(int(input()))
s = sorted(a)
for j,k in enumerate(a):
    print(s[-2]) if k == s[-1] else print(s[-1])
Buggy python submission (verdict: Runtime Error):
n = int(input())
d = list(map(int,input().split()))
d.sort()
if d[int(n/2)-1] == d[(int(n/2))+1]:
    print(0)
else:
    print(d[(int(n/2))] - d[int(n/2)-1])

Fixed submission:
n = int(input())
d = list(map(int,input().split()))
d.sort()
print(d[(int(n/2))] - d[int(n/2)-1])

Buggy python submission (verdict: Runtime Error):
n = int(input())
d = list(map(int,input().split()))
if d[int(n/2)-1] == d[(int(n/2))+1]:
    print(0)
else:
    print(d[(int(n/2))] - d[int(n/2)-1])

Fixed submission:
n = int(input())
d = list(map(int,input().split()))
d.sort()
print(d[(int(n/2))] - d[int(n/2)-1])

Buggy python submission (verdict: Runtime Error):
n = int(input())
d = list(map(int,input().split()))
if d[int(n/2)] == d[int(n/2)+1]:
    print(0)
else:
    print(d[int(n/2)+1] - d[int(n/2)])

Fixed submission:
n = int(input())
d = list(map(int,input().split()))
d.sort()
print(d[(int(n/2))] - d[int(n/2)-1])
Buggy python submission (verdict: Time Limit Exceeded):
n,m = map(int,input().split())
L = [0]*m; R = [0]*m; cnt = 0
for i in range(m):
    L[i],R[i] = map(int,input().split())
for i in range(1, n+1):
    if max(L) <= i <= min(R):
        cnt += 1
print(cnt)

Fixed submission:
n,m = map(int,input().split())
L = [0]*m; R = [0]*m; cnt = 0
for i in range(m):
    L[i],R[i] = map(int,input().split())
ml = max(L); mr = min(R)
print(mr-ml+1) if ml <= mr else print(0)

Buggy python submission (verdict: Time Limit Exceeded):
n,m = map(int,input().split())
lr = []; cnt = 0
for i in range(m):
    l,r = map(int,input().split())
    lr.append(list(range(l,r+1)))
for i in range(1, n+1):
    check = 0
    for j in range(m):
        if i in lr[j]:
            check += 1
    if check == m:
        cnt += 1
print(cnt)

Fixed submission:
n,m = map(int,input().split())
L = [0]*m; R = [0]*m; cnt = 0
for i in range(m):
    L[i],R[i] = map(int,input().split())
ml = max(L); mr = min(R)
print(mr-ml+1) if ml <= mr else print(0)
Buggy python submission (verdict: Runtime Error):
n, k = map(int,input().split())
s = list(input())
if s[k] == "A":
    s[k] = "a"
    print("".join(s))
elif s[k] == "B":
    s[k] = "b"
    print("".join(s))
else:
    s[k] = "c"
    print("".join(s))

Fixed submission:
n, k = map(int,input().split())
s = list(input())
if s[k-1] == "A":
    s[k-1] = "a"
    print("".join(s))
elif s[k-1] == "B":
    s[k-1] = "b"
    print("".join(s))
else:
    s[k-1] = "c"
    print("".join(s))
Buggy python submission (verdict: Time Limit Exceeded):
i = int(input())
list = []
while i > 0:
    list.append(i%10)
    i //= 10
list.reverse()

SUM = sum(list)

if SUM % 9 == 0:
    print('Yes')
else:
    print('No')

Fixed submission:
n = int(input())

if n % 9 == 0:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
A = input().split()

s = 1
for i in range(n):
	s = s*int(A[i])
	
if s > 10**18:
	print(-1)
else:
	print(s)

Fixed submission:
n = int(input())
A = input().split()
A.sort()

s = 1
for i in range(n):
	s*= int(A[i])
	if s > 10**18:
		print(-1)
		exit()

print(s)

Buggy python submission (verdict: Runtime Error):
import numpy as np

N = input()

str_list = list(input().split())

P = np.prod(str_list)

if P > 10 ** 18:
	print(-1)
else:
	print(P)

Fixed submission:
n = int(input())
A = input().split()
A.sort()

s = 1
for i in range(n):
	s*= int(A[i])
	if s > 10**18:
		print(-1)
		exit()

print(s)
Buggy python submission (verdict: Time Limit Exceeded):
from operator import mul
from functools import reduce
N, K = map(int, input().split())
As = list(map(int, input().split()))
base = []
ans2=0
for n in range(K, N+1):
    ans1=ans2
    start = n-K
    ans = 1
    ans = reduce(mul, As[start:n])
    ans2 = ans
    if n != K:
        if ans1 < ans2:
            print("Yes")
        else:
            print("No")

Fixed submission:
N, K = map(int, input().split())
As = list(map(int, input().split()))
ans2=0
for n in range(K+1, N+1):
    ans1 = As[n-K-1]
    ans2 = As[n-1]
    if ans1 < ans2:
        print("Yes")
    else:
        print("No")

Buggy python submission (verdict: Time Limit Exceeded):
from operator import mul
from functools import reduce
N, K = map(int, input().split())
As = list(map(int, input().split()))
base = []
ans2=0
for n in range(K, N+1):
    ans1=ans2
    start = n-K
    ans = 1
    ans = reduce(mul, As[start:n])
    ans2 = ans
    if n != K:
        if ans1 < ans2:
            print("Yes")
        else:
            print("No")

Fixed submission:
N, K = map(int, input().split())
As = list(map(int, input().split()))
ans2=0
for n in range(K+1, N+1):
    ans1 = As[n-K-1]
    ans2 = As[n-1]
    if ans1 < ans2:
        print("Yes")
    else:
        print("No")

Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
As = list(map(int, input().split()))
base = []
ans2=0
for n in range(K, N+1):
    ans1=ans2
    start = n-K
    ans = 1
    for a in As[start:n]:
        ans *= a
    ans2 = ans
    if n != K:
        if ans1 < ans2:
            print("Yes")
        else:
            print("No")

Fixed submission:
N, K = map(int, input().split())
As = list(map(int, input().split()))
ans2=0
for n in range(K+1, N+1):
    ans1 = As[n-K-1]
    ans2 = As[n-1]
    if ans1 < ans2:
        print("Yes")
    else:
        print("No")

Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
As = list(map(int, input().split()))
base = []
for n in range(K, N+1):
    start = n-K
    ans = 1
    for a in As[start:n]:
        ans *= a
    base.append(ans)
for n in range(len(base)-1):
    if base[n+1] > base[n]:
        print("Yes")
    else:
        print("No")

Fixed submission:
N, K = map(int, input().split())
As = list(map(int, input().split()))
ans2=0
for n in range(K+1, N+1):
    ans1 = As[n-K-1]
    ans2 = As[n-1]
    if ans1 < ans2:
        print("Yes")
    else:
        print("No")
Buggy python submission (verdict: Runtime Error):
N = int(input())
As = list(map(int, input().split()))
judge = max(As)
max_index = As.index(judge)
preans = []
hand = 1000
kabu = 0
while As:
    a = As.pop(0)
    if a < judge:
        preans.append(a)
    else:
        buy = min(preans)
        while hand >= buy:
            kabu += 1
            hand-= buy
        hand += kabu * a
        kabu = 0
        preans = []
        if As:
            judge = max(As)
print(hand)

Fixed submission:
N = int(input())
As = list(map(int, input().split()))
yen = 1000
kabu = 0
for n in range(N-1):
    if As[n] < As[n+1]:
        kabu += yen // As[n]
        yen -= kabu * As[n]
        yen += kabu * As[n+1]
        kabu = 0
print(yen)

Buggy python submission (verdict: Runtime Error):
N = int(input())
As = list(map(int, input().split()))
judge = As[0]
preans = []
hand = 1000
kabu = 0
while As:
    a = As.pop(0)
    if a <= judge:
        preans.append(a)
    else:
        buy = min(preans)
        while hand >= buy:
            kabu += 1
            hand-= buy
        hand += kabu * a
        judge = a
        kabu = 0
        preans = []
print(hand)

Fixed submission:
N = int(input())
As = list(map(int, input().split()))
yen = 1000
kabu = 0
for n in range(N-1):
    if As[n] < As[n+1]:
        kabu += yen // As[n]
        yen -= kabu * As[n]
        yen += kabu * As[n+1]
        kabu = 0
print(yen)
Buggy python submission (verdict: Time Limit Exceeded):
import networkx as nx

path = nx.Graph()
room_num, path_num = map(int, input().split())
for i in range(1, room_num):
	path.add_node(i)
for _ in range(path_num):
    a, b = map(int, input().split())
    path.add_edge(a, b)
if nx.is_connected(path):
    print("Yes")
    ans = []
    for n in range(2, room_num+1):
        preans = nx.shortest_path(path, target=1)
    for n in range(2, room_num+1):
    	print(preans[n][1])
else:
    print("No")

Fixed submission:

from collections import deque

room_num, path_num = map(int, input().split(" "))
graph = [[] for _ in range(room_num)]
dis = [-1] * room_num
count = [0] * room_num
count[0] = 1
for _ in range(path_num):
    a, b = map(int, input().split(" "))
    graph[a-1].append(b-1)
    graph[b-1].append(a-1)
dis[0] = 0
q = deque()
q.append(0)
while q:
    pop = q.popleft()
    for n in graph[pop]:
        if count[n] ==1:
            continue
        else:
            count[n] = 1
            dis[n] = pop+1
            q.append(n)
if sum(dis) == room_num:
    print("No")
else:
    del dis[0]
    print("Yes")
    for s in dis:
        print(s)

Buggy python submission (verdict: Time Limit Exceeded):
import networkx as nx

path = nx.Graph()
room_num, path_num = map(int, input().split())
for i in range(1, room_num):
	path.add_node(i)
for _ in range(path_num):
    a, b = map(int, input().split())
    path.add_edge(a, b)
if nx.is_connected(path):
    print("Yes")
    ans = []
    for n in range(2, room_num+1):
        preans = nx.shortest_path(path, source=n, target=1)
        ans.append(preans[1])
    for n in ans:
      print(n)
else:
    print("No")

Fixed submission:

from collections import deque

room_num, path_num = map(int, input().split(" "))
graph = [[] for _ in range(room_num)]
dis = [-1] * room_num
count = [0] * room_num
count[0] = 1
for _ in range(path_num):
    a, b = map(int, input().split(" "))
    graph[a-1].append(b-1)
    graph[b-1].append(a-1)
dis[0] = 0
q = deque()
q.append(0)
while q:
    pop = q.popleft()
    for n in graph[pop]:
        if count[n] ==1:
            continue
        else:
            count[n] = 1
            dis[n] = pop+1
            q.append(n)
if sum(dis) == room_num:
    print("No")
else:
    del dis[0]
    print("Yes")
    for s in dis:
        print(s)
Buggy python submission (verdict: Runtime Error):
S, W = map(int, input().split())
if W >= S:
    print("unsafe")
else:
    print("safe")S, W = map(int, input().split())
if W >= S:
    print("unsafe")
else:
    print("safe")

Fixed submission:
S, W = map(int, input().split())
if W >= S:
    print("unsafe")
else:
    print("safe")
Buggy python submission (verdict: Time Limit Exceeded):
import heapq

city_num, road_num, init_silver = map(int, input().split())
init_silver  = min(2500, init_silver)

G = [[] for _ in range(city_num)]
for _ in range(road_num):
    A, B, cost, time_cost = map(int, input().split())
    A, B = A-1, B-1
    G[B].append([A, cost, time_cost])
    G[A].append([B, cost, time_cost])

for n in range(city_num):
    cost, time_cost = map(int, input().split())
    G[n].append([n, -cost, time_cost])

dp = [[float("inf")] * 2501 for _ in range(city_num)]
dp[0][init_silver] = 0
hq = [(0, 0, init_silver)]
while hq:
    time, node, silver = heapq.heappop(hq)
    for to, silver_cost, time_cost in G[node]:
        remain = min(silver - silver_cost, 2500)
        if remain < 0:
            continue
        dp_next_value = time + time_cost
        if dp[to][remain] <= dp_next_value:
            continue
        dp[to][remain] = dp_next_value
        hq.append([dp_next_value, to, remain])
print(*[min(d) for d in dp[1:]], sep="\n")

Fixed submission:
import heapq
N, M, init_silver = map(int, input().split())
MAX_COST = 2500
init_silver = min(init_silver, MAX_COST)

G = [[] for _ in range(N)]
for i in range(M):
    u, v, silver_cost, time_cost = map(int, input().split())
    u, v = u - 1, v - 1
    G[u].append([v, silver_cost, time_cost])
    G[v].append([u, silver_cost, time_cost])

change_rate, change_cost = [], []
for i in range(N):
    rate, cost = map(int, input().split())
    G[i].append([i, -rate, cost])  # これを追加！
    change_rate.append(rate)
    change_cost.append(cost)


# dp[i][silver] := 頂点iにいて銀貨をsilver枚持っているような状況を作るために必要な最小時間
dp = [[float('inf')] * (MAX_COST + 1) for _ in range(N)]
dp[0][init_silver] = 0

# 優先度付きキュー: (time, node, silver)
hq = [(0, 0, init_silver)]
while hq:
    time, node, silver = heapq.heappop(hq)

    for to, silver_cost, time_cost in G[node]:
        remain_silver = min(silver - silver_cost, MAX_COST)
        if remain_silver < 0:
            continue

        dp_next_value = time + time_cost
        if dp[to][remain_silver] <= dp_next_value:
            continue

        dp[to][remain_silver] = dp_next_value
        heapq.heappush(hq, (dp_next_value, to, remain_silver))

print(*[min(d) for d in dp[1:]], sep="\n")
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
As = list(map(int, input().split()))
preans = [n for n in range(N)]
for n in range(1, N):
    preans[n] = As[n-1] - 1
del preans[0]
for n in range(N):
    print(preans.count(n))

Fixed submission:
N = int(input())
As = list(map(int, input().split()))
preans = [0 for _ in range(N)]
for a in As:
    preans[a-1] += 1
for n in preans:
    print(n)
Buggy python submission (verdict: Runtime Error):
a = int(input())
b = list(map(int,input().split()))
bmax = 0
ans = 0
for i in range(a):
    if i == 0:
        bmax = a[i]
    else:
        if bmax < a[i]:
            bmax = a[i]
        elif bmax > a[i]:
            ans += bmax - a[i]
print(str(ans))

Fixed submission:
a = int(input())
b = list(map(int,input().split()))
bmax = 0
ans = 0
for i in range(a):
    if i == 0:
        bmax = b[i]
    else:
        if bmax < b[i]:
            bmax = b[i]
        elif bmax > b[i]:
            ans += bmax - b[i]
print(str(ans))
Buggy python submission (verdict: Time Limit Exceeded):
a = list(map(int,input().split()))
b = list(map(int,input().split()))

n = a[0]
k = a[1]

c = []
bfr = 0
aft = 0
for i in range(k-1, n):
    aft = 0
    if bfr != 0:
        aft = (bfr / b[i - k]) * b[i] 
        if bfr < aft:
            c.append("Yes")
        else:
            c.append("No")
        bfr = aft
    else:
        bfr = 1
        for j in range(0, k):
            bfr *= b[j]
    
            
s_n = '\n'.join(c)
print(s_n)   

Fixed submission:
a = list(map(int,input().split()))
b = list(map(int,input().split()))

n = a[0]
k = a[1]

c = []
bfr = 0
aft = 0
for i in range(k-1, n):
    if i != k-1:
        if b[i - k] < b[i]:
            c.append("Yes")
        else:
            c.append("No")
    
            
s_n = '\n'.join(c)
print(s_n)

Buggy python submission (verdict: Time Limit Exceeded):
a = list(map(int,input().split()))
b = list(map(int,input().split()))

n = a[0]
k = a[1]

c = []
bfr = 0
aft = 0
for i in range(k-1, n):
    aft = 0
    if bfr != 0:
        aft = (bfr / b[i - k]) * b[i] 
        if bfr < aft:
            c.append("Yes")
        else:
            c.append("No")
        bfr = aft
    else:
        bfr = 1
        for j in range(0, k):
            bfr *= b[j]
    
            
s_n = '\n'.join(c)
print(s_n)   

Fixed submission:
a = list(map(int,input().split()))
b = list(map(int,input().split()))

n = a[0]
k = a[1]

c = []
bfr = 0
aft = 0
for i in range(k-1, n):
    if i != k-1:
        if b[i - k] < b[i]:
            c.append("Yes")
        else:
            c.append("No")
    
            
s_n = '\n'.join(c)
print(s_n)

Buggy python submission (verdict: Time Limit Exceeded):
a = list(map(int,input().split()))
b = list(map(int,input().split()))

n = a[0]
k = a[1]

c = []
bfr = 0
aft = 0
for i in range(k-1, n):
    aft = 1
    for j in reversed(range(k)):
        aft *= b[i - j]
    if bfr != 0:
        if bfr < aft:
            c.append("Yes")
        else:
            c.append("No")
    bfr = aft
            
s_n = '\n'.join(c)
print(s_n)   

Fixed submission:
a = list(map(int,input().split()))
b = list(map(int,input().split()))

n = a[0]
k = a[1]

c = []
bfr = 0
aft = 0
for i in range(k-1, n):
    if i != k-1:
        if b[i - k] < b[i]:
            c.append("Yes")
        else:
            c.append("No")
    
            
s_n = '\n'.join(c)
print(s_n)

Buggy python submission (verdict: Time Limit Exceeded):
a = list(map(int,input().split()))
b = list(map(int,input().split()))

n = a[0]
k = a[1]

c = []

for i in range(k-1, n):
    p = 1
    for j in reversed(range(k)):
        p *= b[i - j]
    c.append(p)
        
for l in range(1, n - k + 1):
    if c[l] > c[l - 1]:
        print("Yes")
    else:
        print("No")

Fixed submission:
a = list(map(int,input().split()))
b = list(map(int,input().split()))

n = a[0]
k = a[1]

c = []
bfr = 0
aft = 0
for i in range(k-1, n):
    if i != k-1:
        if b[i - k] < b[i]:
            c.append("Yes")
        else:
            c.append("No")
    
            
s_n = '\n'.join(c)
print(s_n)