Problem:


Score: 300 points

Problem Statement

M-kun is a student in Aoki High School, where a year is divided into N terms.

There is an exam at the end of each term. According to the scores in those exams, a student is given a grade for each term, as follows:

For the first through (K-1)-th terms: not given.

For each of the K-th through N-th terms: the multiplication of the scores in the last K exams, including the exam in the graded term.

M-kun scored A_i in the exam at the end of the i-th term.

For each i such that K+1 \leq i \leq N, determine whether his grade for the i-th term is strictly greater than the grade for the (i-1)-th term.

Constraints

2 \leq N \leq 200000

1 \leq K \leq N-1

1 \leq A_i \leq 10^{9}

All values in input are integers.

Input

Input is given from Standard Input in the following format:

N K
A_1 A_2 A_3 \ldots A_N

Output

Print the answer in N-K lines.

The i-th line should contain Yes if the grade for the (K+i)-th term is greater than the grade for the (K+i-1)-th term, and No otherwise.

Sample Input 1

5 3
96 98 95 100 20

Sample Output 1

Yes
No

His grade for each term is computed as follows:

3-rd term: (96 \times 98 \times 95) = 893760

4-th term: (98 \times 95 \times 100) = 931000

5-th term: (95 \times 100 \times 20) = 190000

Sample Input 2

3 2
1001 869120 1001

Sample Output 2

No

Note that the output should be No if the grade for the 3-rd term is equal to the grade for the 2-nd term.

Sample Input 3

15 7
3 1 4 1 5 9 2 6 5 3 5 8 9 7 9

Sample Output 3

Yes
Yes
No
Yes
Yes
No
Yes
Yes



Sample input:
5 3
96 98 95 100 20


Sample output:
Yes
No

Submission status: Time Limit Exceeded

Solution code:
import math,itertools,fractions,heapq,collections,bisect,sys,queue,copy

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7
dd=[(-1,0),(0,1),(1,0),(0,-1)]
ddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
# def LF(): return [float(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return input()

def main():
  n,k=LI()
  l=LI()
  ind=0

  sm=1
  for i in range(k):
    sm*=l[i]

  before=sm
  ans=[]
  nxt=k
  for _ in range(n-k):
    sm//=l[ind]
    sm*=l[nxt]

    if before<sm:
      ans.append('Yes')
    else:
      ans.append('No')

    before=sm
    ind+=1
    nxt+=1

  for x in ans:
    print(x)

main()
# print(main())

Submission status: Time Limit Exceeded

Solution code:
N, K = map(int, input().split(' '))
A = tuple(map(int, input().split(' ')))

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

pre = mul

for i in range(K, N):
    mul = pre
    mul //= A[i - K]
    mul *= A[i]
    if mul > pre:
        print('Yes')
    else:
        print('No')
    pre = mul

Submission status: Time Limit Exceeded

Solution code:
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

N, K = mapint()
As = list(mapint())

now = 1
for i in range(N):
    a = As[i]
    if i<K:
        now*=a
    else:
        past = now
        now = now*a//As[i-K]
        if now>past:
            print('Yes')
        else:
            print('No')

Submission status: Time Limit Exceeded

Solution code:
#from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations,permutations,accumulate # (string,3) 3回
#from collections import deque
from collections import deque,defaultdict,Counter
import decimal
import re
#import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#
# my_round_int = lambda x:np.round((x*2 + 1)//2)
# 四捨五入
import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7
#mod = 9982443453
def readInts():
  return list(map(int,input().split()))
def I():
  return int(input())
n,k = readInts()
A = readInts()
pa = 1
for i in range(k):
    pa *= A[i]
for i in range(k,n):
    nya = pa
    pa //= A[i-k]
    pa *= A[i]
    #print(nya,pa)
    if nya < pa:
        print('Yes')
    else:
        print('No')

Submission status: Time Limit Exceeded

Solution code:
n,k=map(int,input().split())
a=list(map(int,input().split()))
p=1
for i in a[:k]:
    p*=i
for i in range(k,len(a)):
    q=p*a[i]/a[i-k]
    if q>p: print("Yes")
    else: print("No")
    p=q

Submission status: Time Limit Exceeded

Solution code:
n, k = map(int, input().split())
a = list(map(int, input().split()))
befscore = 1
score = 1
f = True
for i in range(n):
    score *= a[i]

    if i >= k:
        score //= a[i - k]
        if befscore >= score:
            print("No")
        else:
            print("Yes")

    befscore = score

Submission status: Time Limit Exceeded

Solution code:
n, k = map(int, input().split())
a = list(map(int, input().split()))

cur = 1
for i in range(k):
	cur *= a[i]

for i in range(0, n - k):
	new = cur
	new *= a[i + k]
	new //= a[i] 
	if new > cur:
		print('Yes')
	else:
		print('No')

	cur = new

Submission status: Time Limit Exceeded

Solution code:
import sys

sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline
f_inf = float('inf')
mod = 10 ** 9 + 7


def resolve():
    n, k = map(int, input().split())
    A = list(map(int, input().split()))

    R = [1]
    for i in range(n):
        R.append(R[-1] * A[i])

    prev = R[k]
    for i in range(k + 1, n + 1):
        now = R[i] // R[i - k]
        print("Yes" if prev < now else "No")
        prev = now


if __name__ == '__main__':
    resolve()

Submission status: Time Limit Exceeded

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

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

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

Submission status: Time Limit Exceeded

Solution code:
from sys import stdin
input = stdin.readline

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

ans_ls = []
tmp = 1

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

ans_ls.append(tmp)

for i in range(K, N):
    tmp //= A[i - K]
    tmp *= A[i]
    ans_ls.append(tmp)

for i in range(len(ans_ls) - 1):
    if ans_ls[i + 1] <= ans_ls[i]:
        print("No")
    else:
        print("Yes")

Submission status: Time Limit Exceeded

Solution code:
N,K=map(int,input().split())
A=list(map(int,input().split()))
ans=1
for i in range(K):
  ans*=A[i]
for i in range(K,N):
  bns=ans//A[i-K]*A[i]
  if ans<bns:
    print('Yes')
  else:
    print('No')
  ans=bns

Submission status: Time Limit Exceeded

Solution code:
N, K = input().split()
N = int(N)
K = int(K)
a = input().split()
A = [int(u) for u in a]
Prod = 1
G = []
for i in range(0, N):
	Prod *= A[i]
	if i >= K:
		Prod = Prod // A[i - K]
	if i >= K - 1:
		G.append(Prod)

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

Submission status: Time Limit Exceeded

Solution code:
#X = int(input())
#S = str(input())
N, K= map(int, input().split())
A = list(map(int, input().split()))

start = 1
for i in range(K):
  start *= A[i]
  
now = start    
for i in range(N - K):
  now *= A[K + i]
  now /= A[i]
  #print(start, now)
  if now > start:
    print("Yes")
  else:
    print("No")
  start = now

Submission status: Time Limit Exceeded

Solution code:
import sys

sys.setrecursionlimit(10 ** 8)
ini = lambda: int(sys.stdin.readline())
inm = lambda: map(int, sys.stdin.readline().split())
inl = lambda: list(inm())
ins = lambda: sys.stdin.readline().rstrip()
debug = lambda *a, **kw: print("\033[33m", *a, "\033[0m", **dict(file=sys.stderr, **kw))

N, K = inm()
A = inl()


def solve():
    p = 1
    for i in range(K):
        p *= A[i]
    for i in range(K, N):
        if A[i] > A[i - K]:
            print("Yes")
        else:
            print("No")


solve()

Submission status: Time Limit Exceeded

Solution code:
n,k=map(int,input().split())
a=list(map(int,input().split()))
p=1
for i in a[:k]:
    p*=i
for i,j in zip(a[k:],a):
    q=p*i/j
    if q>p: print("Yes")
    else: print("No")
    p=q

Submission status: Time Limit Exceeded

Solution code:
import io
import os

from collections import Counter, defaultdict, deque


def solve(N, K, A):
    window = deque()
    val = 1
    grades = []
    for x in A:
        window.append(x)
        val *= x

        if len(window) > K:
            val //= window.popleft()
        if len(window) == K:
            grades.append(val)
    ans = []
    for x, y in zip(grades, grades[1:]):
        if x < y:
            ans.append("Yes")
        else:
            ans.append("No")

    return "\n".join(ans)


if __name__ == "__main__":
    input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
    N, K = [int(x) for x in input().split()]
    A = [int(x) for x in input().split()]
    ans = solve(N, K, A)
    print(ans)

Submission status: Time Limit Exceeded

Solution code:
def main():
    N, K = map(int, input().split())
    A = list(map(int, input().split()))

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

    for i in range(N-K):
        t = tmp // A[i]
        t *= A[i+K]
        if t > tmp:
            print('Yes')
        else:
            print('No')
        tmp = t


if __name__ == "__main__":
    main()

Submission status: Time Limit Exceeded

Solution code:
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do():
    n,k=INTM()
    A=LIST()
    #flg=True
    Ave=[0]*(n-k+1)
    for i in range(n-k+1):
        Ave[i]=float(sum(A[i:i+k])/k)
    for i in range(n-k):
        if Ave[i+1]>Ave[i]:
            print('Yes')
        else:
            print('No')
        
    
    
if __name__ == '__main__':
    do()

Submission status: Time Limit Exceeded

Solution code:
n, k = map(int, input().split())
dat = list(map(int, input().split()))

prev = 1
for i in range(k):
    prev *= dat[i]

for i in range(n-k):
    new = dat[k + i]
    nukeru = dat[i]
    newval = prev // nukeru * new
    if newval > prev:
        print("Yes")
    else:
        print("No")
    prev = newval

Submission status: Time Limit Exceeded

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

x = 1
for a in A[:K]:
    x *= a
for i in range(K, N):
    xx = x // A[i-K] * A[i]
    if xx > x:
        print('Yes')
    else:
        print('No')
    x = xx

Submission status: Time Limit Exceeded

Solution code:
N, K = map(int, input().split())
A = list(map(int, input().split()))
answer = 'Yes'
score = 1
for i in range(K):
    score *= A[i]

for i in range(N - K):
    next_score = score * A[K + i] // A[i]
    print('Yes' if next_score > score else 'No')
    score = next_score

Submission status: Time Limit Exceeded

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

if K == 1:
    for a, b in zip(A[:-1], A[1:]):
        if a < b:
            print("Yes")
        else:
            print("No")
else:
    score = 1
    for i in range(K):
        score *= A[i]
    for i in range(K, N):
        tmp = score // A[i - K] * A[i]
        if tmp > score:
            print("Yes")
        else:
            print("No")
        score = tmp

Submission status: Time Limit Exceeded

Solution code:
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()

Submission status: Time Limit Exceeded

Solution code:
n, k = map(int, input().split())
a = list(map(int, input().split()))

mul = 1
for i in range(k):
	mul *= a[i]
last = mul
for i in range(k, n):
	mul //= a[i-k]
	mul *= a[i]
	if mul > last:
		print("Yes")
	else:
		print("No")
	last = mul

Submission status: Time Limit Exceeded

Solution code:
import sys
sys.setrecursionlimit(10**7) #再帰関数の上限,10**5以上の場合python
import math
from copy import copy, deepcopy
from copy import deepcopy as dcp
from operator import itemgetter
from bisect import bisect_left, bisect, bisect_right#2分探索
#bisect_left(l,x), bisect(l,x)#aはソート済みである必要あり。aの中からx未満の要素数を返す。rightだと以下
from collections import deque, defaultdict
#deque(l), pop(), append(x), popleft(), appendleft(x)
#q.rotate(n)で → にn回ローテート
from collections import Counter#文字列を個数カウント辞書に、
#S=Counter(l),S.most_common(x),S.keys(),S.values(),S.items()
from itertools import accumulate,combinations,permutations,product#累積和
#list(accumulate(l))
from heapq import heapify,heappop,heappush
#heapify(q),heappush(q,a),heappop(q) #q=heapify(q)としないこと、返り値はNone
from functools import reduce,lru_cache#pypyでもうごく
#@lru_cache(maxsize = None)#maxsizeは保存するデータ数の最大値、2**nが最も高効率
from decimal import Decimal

def input(): 
    x=sys.stdin.readline()
    return x[:-1] if x[-1]=="\n" else x
def printe(*x):print("## ",*x,file=sys.stderr)
def printl(li): _=print(*li, sep="\n") if li else None
def argsort(s, return_sorted=False): 
    inds=sorted(range(len(s)), key=lambda k: s[k])
    if return_sorted: return inds, [s[i] for i in inds]
    return inds
def alp2num(c,cap=False): return ord(c)-97 if not cap else ord(c)-65
def num2alp(i,cap=False): return chr(i+97) if not cap else chr(i+65)
def matmat(A,B):
    K,N,M=len(B),len(A),len(B[0])
    return [[sum([(A[i][k]*B[k][j]) for k in range(K)]) for j in range(M)] for i in range(N)]
def matvec(M,v):
    N,size=len(v),len(M)
    return [sum([M[i][j]*v[j] for j in range(N)]) for i in range(size)]
def T(M):
    n,m=len(M),len(M[0])
    return [[M[j][i] for j in range(n)] for i in range(m)]
def binr(x): return bin(x)[2:]
def bitcount(x): #xは64bit整数
    x= x - ((x >> 1) & 0x5555555555555555)
    x= (x & 0x3333333333333333) + ((x >> 2) & 0x3333333333333333)
    x= (x + (x >> 4)) & 0x0f0f0f0f0f0f0f0f 
    x+= (x >> 8); x+= (x >> 16); x+= (x >> 32) 
    return x & 0x7f

class segtree():#seg=segtree(A),単位元とsegfuncを指定すること
    def __init__(self,A,ide=1):#単位元とsegfuncを指定すること
        n=len(A)
        num=2**(n-1).bit_length()#n以上の最小の2のべき乗
        seg=[ide]*(2*num-1)
        segfunc=self.segfunc
        self.ide,self.n,self.num,self.seg = ide, n, num, seg
        for i in range(n): seg[i+num-1]=A[i]#setvalue
        for i in range(num-2,-1,-1):seg[i]=segfunc(seg[2*i+1],seg[2*i+2])#build
    
    def segfunc(self,x,y):return x*y #seg木の基本関数
    
    def update(self,k,x):#Aのk番目の要素をxに置き換える,計算量log(N)
        k += self.num-1
        seg,segfunc=self.seg,self.segfunc
        seg[k] = x
        while k:
            k = (k-1)//2
            seg[k] = segfunc(seg[k*2+1],seg[k*2+2])
    
    def query(self,p,q):#区間[p,q)の累積segfuncを求める,計算量log(N)
        if q<=p: return self.ide
        num,segfunc,seg=self.num,self.segfunc,self.seg
        p += num-1; q += num-2
        res=self.ide
        while q-p>1:
            if p&1 == 0: res = segfunc(res,seg[p])
            if q&1 == 1:
                res = segfunc(res,seg[q])
                q -= 1
            p,q = p//2, (q-1)//2
        if p == q: res = segfunc(res,seg[p])
        else: res = segfunc(segfunc(res,seg[p]),seg[q])
        return res 

def main():
    mod = 1000000007
    #w.sort(key=itemgetter(1),reverse=True)  #二個目の要素で降順並び替え

    #N = int(input())
    N, K = map(int, input().split())
    A = tuple(map(int, input().split())) #1行ベクトル
    #L = tuple(int(input()) for i in range(N)) #改行ベクトル
    #S = tuple(tuple(map(int, input().split())) for i in range(N)) #改行行列
    seg=segtree(A)
    pr=seg.query(0,K)
    for i in range(K,N):
        c=seg.query(i-K+1,i+1)
        if c>pr:
            print('Yes')
        else:
            print('No')
        pr=c





if __name__ == "__main__":
    main()

Submission status: Time Limit Exceeded

Solution code:
import bisect
import copy
import heapq
import math
import sys
from collections import *
from functools import lru_cache
from itertools import accumulate, combinations, permutations, product
def input():
    return sys.stdin.readline()[:-1]
def ruiseki(lst):
    return [0]+list(accumulate(lst))
sys.setrecursionlimit(500000)
mod=pow(10,9)+7
al=[chr(ord('a') + i) for i in range(26)]
direction=[[1,0],[0,1],[-1,0],[0,-1]]

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

cnt=1
for i in range(k):
    cnt*=a[i]

for i in range(k,n):
    tmp=cnt
    cnt*=a[i]
    cnt//=a[i-k]
    # print(tmp,cnt)
    if tmp<cnt:
        print("Yes")
    else:
        print("No")

Submission status: Time Limit Exceeded

Solution code:
# -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub


import sys
# sys.setrecursionlimit(10**6)
# buff_readline = sys.stdin.buffer.readline
buff_readline = sys.stdin.readline
readline = sys.stdin.readline

INF = 2**62-1


def read_int():
    return int(buff_readline())


def read_int_n():
    return list(map(int, buff_readline().split()))


def read_float():
    return float(buff_readline())


def read_float_n():
    return list(map(float, buff_readline().split()))


def read_str():
    return readline().strip()


def read_str_n():
    return readline().strip().split()

def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(N, K, A):
    p = reduce(mul, A[:K], 1)
    for i, a in enumerate(A[K:]):
        np = p//A[i] * a
        if p < np:
            print('Yes')
        else:
            print('No')
        p = np


def main():
    N, K = read_int_n()
    A = read_int_n()
    (slv(N, K, A))


if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

Solution code:
import sys

sys.setrecursionlimit(10 ** 8)
ini = lambda: int(sys.stdin.readline())
inm = lambda: map(int, sys.stdin.readline().split())
inl = lambda: list(inm())
ins = lambda: sys.stdin.readline().rstrip()
debug = lambda *a, **kw: print("\033[33m", *a, "\033[0m", **dict(file=sys.stderr, **kw))

N, K = inm()
A = inl()


def solve():
    p = 1
    for i in range(K):
        p *= A[i]
    for i in range(K, N):
        p1 = p
        p *= A[i]
        p /= A[i - K]
        if p > p1:
            print("Yes")
        else:
            print("No")


solve()

Submission status: Time Limit Exceeded

Solution code:
# Fast IO (only use in integer input)

import os,io
input=io.BytesIO(os.read(0,os.fstat(0).st_size)).readline

N,K = map(int,input().split())
a = list(map(int,input().split()))
ans = ""
for i in range(N):
    if i < K:
        continue
    if a[i] <= a[i - K]:
        ans += "No"
    else:
        ans += "Yes"
    if i != N-1:
        ans += "\n"
print(ans)

Submission status: Time Limit Exceeded

Solution code:
n, k = map(int, input().split())
A = list(map(int, input().split()))

score = [1] * (n - k + 1)
for i in range(k):
    score[0] *= A[i]

for i in range(1, n - k + 1):
    score[i] = score[i - 1] // A[i - 1]
    # score[i] //= A[i]
    score[i] *= A[i + k - 1]
    
# print(score)


for i in range(1, len(score)):
    pre = score[i - 1]
    now = score[i]
    if now > pre:
        print('Yes')
    else:
        print('No')

Submission status: Time Limit Exceeded

Solution code:
n,k=map(int,input().split())
a=list(map(int,input().split()))
b=[1]
for i in range(k):b[0]*=a[i]
for i in range(k,n):
  b.append(b[-1]*a[i]//a[i-k])
for i in range(len(b)-1):
  if b[i]<b[i+1]:print('Yes')
  else:print('No')

Submission status: Time Limit Exceeded

Solution code:
N,K = map(int,input().split())
A = list(map(int,input().split()))
rep = 1
for i in range(K):
    rep *= A[i]

#この段階でrepはK学期の評価
tmp = rep
for i in range(K,N):
    tmp = rep*A[i]//A[i-K]
    if tmp > rep:
        print("Yes")
    else:
        print("No")
    rep = tmp

Submission status: Accepted

Solution code:
n, k = map(int, input().split())
a = list(map(int, input().split()))
for i in range(k, n):
	print('Yes' if a[i] > a[i-k] else 'No')

Submission status: Accepted

Solution code:
# coding:UTF-8
import sys
from math import factorial

MOD = 10 ** 9 + 7
INF = float('inf')

N, K = list(map(int, input().split()))     # スペース区切り連続数字
A = list(map(int, input().split()))     # スペース区切り連続数字

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

Submission status: Accepted

Solution code:
n, k = map(int, input().split())
a = list(map(int,input().split()))
for i in range(n-k):
    if a[i] < a[i+k]:
        print("Yes")
    else:
        print("No")

Submission status: Accepted

Solution code:
N,K=list(map(int, input().split()))
A=list(map(int, input().split()))
ans=[None]*(N-K)
for i in range(N-K):
  if A[K+i]>A[i]:
    ans[i]='Yes'
  else:
    ans[i]='No'
print(*ans, sep='\n')

Submission status: Accepted

Solution code:
n,k = map(int, input().split())
scores = list(map(int, input().split()))

for i in range(k, n):
  a = scores[i]
  b = scores[i-k]
  if a > b:
    print('Yes')
  else:
    print('No')

Submission status: Accepted

Solution code:
n,k = map(int,input().split())
ls = list(map(int,input().split()))
for i in range(n-k):
    if ls[i] < ls[i+k]:
        print("Yes")
    else:
        print("No")

Submission status: Accepted

Solution code:
n, k = map(int, input().split())
A = list(map(int, input().split()))

for i in range(n-k):
    if A[i] >= A[i+k]:
        print("No")
    else:
        print("Yes")

Submission status: Accepted

Solution code:
n, k = map(int, input().split())
al = list(map(int, input().split()))

for i in range(k, n):
    if al[i-k] < al[i]:
        print('Yes')
    else:
        print('No')

Submission status: Accepted

Solution code:
N, K = map(int, input().split())
A = list(map(int, input().split()))
ACC = []
ACC.append(0)
sum = 0
for a in A:
    sum += a
    ACC.append(sum)


L = N-K+1
prev = ACC[K] - ACC[0]
for i in range(1, L):
    score = ACC[i+K] - ACC[i] 
    if prev < score:
        print("Yes")
    else:
        print("No")
    prev = score

Submission status: Accepted

Solution code:
m, n = map(int, input().split())
l = list(map(int, input().split()))

for i in range(m-n):
    if l[i] < l[i+n]:
        print('Yes')
    else:
        print('No')

Submission status: Accepted

Solution code:
N,K = map(int,input().split())
A = list(map(int,input().split()))
A.insert(0,0)
for i in range(K+1,N+1):
    if A[i]>A[i-K]:
        print("Yes")
    else:
        print("No")

Submission status: Accepted

Solution code:
n,k=map(int,input().split())
a=list(map(int,input().split()))
for i in range(0,n-k):
    if a[i]<a[k+i]:print("Yes")
    else :print("No")

Submission status: Accepted

Solution code:
n,k = map(int, input().split())
a = list(map(int, input().split()))

l = [0]*(n-k+1)
l[0] = sum(a[:k])
for i in range(k,n): l[i-k+1] = l[i-k] + a[i] - a[i-k]
for i in range(1,n-k+1):
  if l[i-1] < l[i]: print("Yes")
  else: print("No")

Submission status: Accepted

Solution code:
n,k = map(int,input().split())
a = list(map(int,input().split()))
for j in range(k,n):
    if a[j-k] < a[j]:
        print('Yes')
    else:
        print('No')

Submission status: Accepted

Solution code:
n,k = map(int,input().split())
a = list(map(int,input().split()))
for i in range(n-k):
  if a[i] < a[i+k]:
    print('Yes')
  else:
    print('No')

Submission status: Accepted

Solution code:
n,k =map(int,input().split())
a=[int(x ) for x in input().split()]
for i in range(k,n):
    if a[i-k]<a[i]:
        print("Yes")
    else:
        print("No")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N,K = map(int,input().split())
A = list(map(int,input().split()))
for i in range(K,N):
    if A[i] > A[i-K]:
        print("Yes")
    else:
        print("No")

Submission status: Accepted

Solution code:
n,k=map(int, input().split())
a=list(map(int, input().split()))
for i in range(n-k):
    if a[i]<a[i+k]:
        print("Yes")
    else:
        print("No")

Submission status: Accepted

Solution code:
a = list(map(int,input().split()))
A = list(map(int,input().split()))
N = a[0]
K = a[1]

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

Submission status: Accepted

Solution code:
n, k = map(int, input().split())
a_l = list(map(int, input().split()))
i = 0
while i < n:
    if i >= k:
        if a_l[i] > a_l[i-k]:
            print('Yes')
        else:
            print('No')
    i+=1

Submission status: Accepted

Solution code:
n,k=map(int,input().split())
A=list(map(int,input().split()))

for i in range(n-k):
    nuke= A[i] 
    hairu= A[k+i] 
    print("YNeos"[nuke>=hairu::2])

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n, k = map(int, input().split())
scores = list(map(int, input().split()))

evals = []
cnt = 0

for i in range(k, n, 1):
    edge = scores[cnt]
    new_edge = scores[i]
    if edge < new_edge:
        print('Yes')
    else:
        print('No')
    cnt += 1

Submission status: Accepted

Solution code:
import numpy as np

# 解説みた
N, K = map(int, input().split())
A = list(map(int, input().split()))

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

"""
・書き始める前に式変形等考える
・判定分を吟味する。（実際の数、今回でいうと積、で比較しない）
"""

Submission status: Accepted

Solution code:
n, k = map(int, input().split())
a = [int(s) for s in input().split()]

for i in range(k, n):
    if a[i] > a[i - k]:
        print('Yes')
    else:
        print('No')

Submission status: Accepted

Solution code:
n, k = map(int, input().split())
lis = list(map(int, input().split()))
lis_score = []


for i in range(n):

  if i >= k:
    lis_edge_right = lis[i]
    lis_edge_left = lis[i-k]
    
    if lis_edge_right > lis_edge_left:
      print("Yes")
    else:
      print("No")

Submission status: Accepted

Solution code:
n,k=map(int,input().split())
a=list(map(int,input().split()))

for i in range(k,n):
  print("Yes" if a[i-k]<a[i] else "No")

Submission status: Accepted

Solution code:
a,b = map(int,(input().split()))
c = list(map(int,input().split()))
for i in range(a-b):
    print("Yes" if c[i] < c[i+b] else "No")

Submission status: Accepted

Solution code:
n,k= map(int,input().split())
a = list(map(int,input().split()))
for i in range(n-k):
         if a[i] < a[i + k]:
                  print("Yes")
         else:
                  print("No")

Submission status: Accepted

Solution code:
import math
# a=int(input())
#b=int(input())
# c=[]
# for i in b:
#     c.append(i)
e1,e2 = map(int,input().split())
f = list(map(int,input().split()))
#j = [input() for _ in range(3)]
cal=1
for i in range(e1-e2):
    if f[i]>=f[i+e2]:
        print("No")
    else:
        print("Yes")

Submission status: Accepted

Solution code:
def main():
    n, k = map(int, input().split())
    results = tuple(map(int, input().split()))

    for i in range(n-k):
        print('Yes' if results[i] < results[i+k] else 'No')



if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N , K = list(map(int, input().split()))
A = list(map(int, input().split()))
score = 1
for i in range(K, N):
  if(A[i] > A[i - K]): print("Yes")
  else: print("No")

Submission status: Accepted

Solution code:
n, k = map(int, input().split())
a = list(map(int, input().split()))
for i in range(k, n):
    if a[i-k] < a[i]:
        print('Yes')
    else:
        print('No')

Submission status: Accepted

Solution code:
N,K = list(map(int, input().split()))
A = [int(i) for i in input().split()]

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

Submission status: Accepted

Solution code:
n, k = map(int, input().split())
a = list(map(int, input().split()))

for i in range(k, n):
    if a[i-k] < a[i]:
        print('Yes')
    else:
        print('No')

Submission status: Accepted

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

score = sum(A[:K])

for i in range(N-K):
    cur = score
    score += A[K+i] - A[i]
    if score > cur:
        print('Yes')
    else:
        print('No')

Submission status: Accepted

Solution code:
n,k = map(int,input().split())
a = list(map(int,input().split()))
b = 1
for i in range(k,n):
    if a[i] > a[i-k]:
        print('Yes')
    else:
        print('No')

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().rstrip()
def main():
    n, k = map(int,input().split())
    A = list(map(int,input().split()))
    for i in range(k,n):
        if A[i-k] < A[i]:
            print("Yes")
        else:
            print("No")

if __name__=='__main__':
    main()

Submission status: Accepted

Solution code:
n,k=map(int,input().split())
a=list(map(int,input().split()))
for i in range(k,n):
  if a[i]>a[i-k]:
    print('Yes')
  else:
    print('No')

Submission status: Accepted

Solution code:
n, k = map(int, input().split())
l = list(map(int, input().split()))
for i in range(1, n - k + 1):
    print("Yes" if l[i - 1] < l[i + k - 1] else "No")

Submission status: Accepted

Solution code:
N,K=map(int,input().split())
A=[int(a) for a in input().split()]
for i in range(K,N):
    if A[i-K] < A[i]:
        print('Yes')
    else:
        print('No')

Submission status: Accepted

Solution code:
N,K = map(int, input().split())
A = [0] + list(map(int, input().split()))

for i in range(K+1, N+1):
    if A[i-K] >= A[i]:
        print('No')
    else:
        print('Yes')

Submission status: Accepted

Solution code:
n,k=map(int,input().split())
A=list(map(int,input().split()))

R=[0]*(n+1)
for i in range(1,n+1):
  R[i]=R[i-1]+A[i-1]

for i in range(1,n-k+1):
  if R[k+i]-R[i]>R[k+i-1]-R[i-1]:
    print('Yes')
  else:
    print('No')

Submission status: Accepted

Solution code:
n, k = map(int, input().split())
a = list(map(int, input().split()))

for i in range(k+1, n+1):
    i -= 1
    if a[i-k] < a[i]:
        print("Yes")
    else:
        print("No")

Submission status: Accepted

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

for i in range(N-K):
    
    if A[i]<A[i+K]:
        print("Yes")
    elif A[i]>=A[i+K]:
        print("No")