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: Accepted

Solution code:
def main():
    import sys
    N,K=list(map(int,sys.stdin.readline().split()))
    A=list(map(int,sys.stdin.readline().split()))
    L=[0]*N
    
    n=0
    for i in range(K,N):
        if A[i]<=A[n]:
            print('No')
        else:
            print('Yes')
        n+=1

main()

Submission status: Accepted

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

sm = 1
for i in range(K):
    sm += A[i]

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

Submission status: Accepted

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

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

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+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[ k + i ] > a[ i ]:
        print( "Yes" )
    else:
        print( "No" )

Submission status: Accepted

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:
    for i in range(K, N):
        if A[i] > A[i-K]:
            print("Yes")
        else:
            print("No")

Submission status: Accepted

Solution code:
import sys, math
import io, os
#data = io.BytesIO(os.read(0,os.fstat(0).st_size)).readline
from bisect import bisect_left as bl, bisect_right as br, insort
from heapq import heapify, heappush, heappop
from collections import defaultdict as dd, deque, Counter
#from itertools import permutations,combinations
def data(): return sys.stdin.readline().strip()
def mdata(): return list(map(int, data().split()))
def outl(var) : sys.stdout.write('\n'.join(map(str, var))+'\n')
def out(var) : sys.stdout.write(str(var)+'\n')
#from decimal import Decimal
from fractions import Fraction
#sys.setrecursionlimit(100000)
INF = float('inf')
mod = int(1e9)+7



n,k=mdata()
a=mdata()
for i in range(k,n):
    if a[i]>a[i-k]:
        out("Yes")
    else:
        out("No")

Submission status: Accepted

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

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

q = deque([])

for i in range(K):
    q.append(A[i])

for i in range(K, N):
    tmp = q.popleft()
    if A[i] <= tmp:
        print("No")
    else:
        print("Yes")
    q.append(A[i])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    n,k = [int(v) for v in input().split()]
    a = [int(v) for v in input().split()]
    
    for (a1,a2) in zip(a, a[k:]):
        print('Yes' if a2>a1 else 'No')

main()

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[k+i]>a[i]:
        print("Yes")
    else:
        print("No")

Submission status: Accepted

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

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()))
result=[]
for i in range(n-k):
    if a[i]<a[i+k]:
        result.append('Yes')
    else:
        result.append('No')
for j in range(n-k):
    print(result[j])

Submission status: Accepted

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()))

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


if __name__ == '__main__':
    resolve()

Submission status: Accepted

Solution code:
import sys


def handler():
    n, m = [int(i) for i in input().strip().split()]
    a = [int(i) for i in input().strip().split()]
    for i in range(m, n):
        if a[i] <= a[i - m]:
            sys.stdout.write('No\n')
        else:
            sys.stdout.write('Yes\n')


def main():
    while True:
        try:
            handler()
        except ValueError:
            continue
        except EOFError:
            break


if __name__ == '__main__':
    main()

Submission status: Accepted

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

sum=0


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

Submission status: Accepted

Solution code:
import sys
import math
import bisect

def main():
    n, k = map(int, input().split())
    A = list(map(int, input().split()))
    for i in range(n):
        if i + k + 1 <= n:
            if A[i+k] > A[i]:
                print('Yes')
            else:
                print('No')

if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

# print(f'{A=}')
for i in range(N - K):
    ans = 'Yes' if A[i] < A[i + K] else 'No'
    print(ans)

Submission status: Accepted

Solution code:
from collections import deque

N,K,*A = map(int, open(0).read().split())
checker = deque(A[:K])
d = deque(A[K:])
for i in range(N-K):
    a = checker.popleft()
    b = d.popleft()
    if b > a:
        print('Yes')
    else:
        print('No')
    checker.append(b)

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+k]-A[i] > 0:
        print("Yes")
    else:
        print("No")

Submission status: Accepted

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

ans = []
for i in range(k, n):
    if a[i-k] < a[i]:
        ans.append("Yes")
    else:
        ans.append("No")
print("\n".join(ans))

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[k+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")
  else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,k = map(int,input().split())
a = list(map(int,input().split()))
p = 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().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:
        pass
    else:
        past = As[i-K]
        now = a
        if now>past:
            print('Yes')
        else:
            print('No')

Submission status: Accepted

Solution code:
import sys
from operator import itemgetter

sys.setrecursionlimit(10**9)
input = sys.stdin.readline

def ii(): return int(input())
def mi(): return map(int, input().split())
def lmi(): return list(map(int, input().split()))
def iif(n): return [int(input()) for _ in range(n)]
def lmif(n): return [list(map(int, input().split())) for _ in range(n)]
def ss(): return input().split()

def main():
    mod = 1000000007
    
    n, k = mi()
    A = lmi()

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

main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import io
import os

from collections import Counter, defaultdict, deque


def solve(N, K, A):
    window = deque()
    ans = []
    for x in A:
        window.append(x)

        if len(window) > K:
            if window.popleft() < x:
                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: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**9)

def mi(): return map(int,input().split())
def ii(): return int(input())
def isp(): return input().split()
def deb(text): print("-------\n{}\n-------".format(text))

INF=10**20
def main():
    N,K=mi()
    A= [0] + list(mi())

    for j in range(1,N-K+1):
        if A[K+j] > A[j]:
            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()))
ans=[0]*(n-k)
for i in range(k,n):
    ans[i-k]=(a[i]>a[i-k])
for i in range(0,n-k):
    print("Yes" if ans[i] else "No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    
    N_all, K_part = map(int, input().split())
    scores = list(map(int, input().split()))

    init = 1

    for i in range(N_all - K_part):
        index = i + K_part
        after = scores[index]
        before = scores[i]
        
        if (before < after):
            print('Yes')
        else:
            print('No')
        

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
from collections import deque

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

for a1,a2 in zip(al[0:n-k], al[-(n-k):]):
    # print(a1,a2)
    if a1 < a2:
        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=[0]+list(map(int, input().split()))
    for i in range(k+1,n+1):
        if A[i] > A[i-k]:
            print('Yes')
        else:
            print('No') 
 
if __name__=='__main__':
    main()

Submission status: Accepted

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

main()

Submission status: Accepted

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

zero = [0] * N
for i in range(N) :
  if A[i] == 0 :
    zero[i] += 1
for i in range(1, N) :
  zero[i] += zero[i - 1]
    
for i in range(K, N) :
  if A[i] > A[i - K] and zero[i] == zero[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[k+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")
    else:
        print("No")

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**7)

readline = sys.stdin.buffer.readline
def readstr():return readline().rstrip().decode()
def readstrs():return list(readline().decode().split())
def readint():return int(readline())
def readints():return list(map(int,readline().split()))
def printrows(x):print('\n'.join(map(str,x)))
def printline(x):print(' '.join(map(str,x)))

n,k = readints()
a = readints()

ans = []
for i in range(n-k):
    if a[i] < a[i+k]:
        ans.append('Yes')
    else:
        ans.append('No')
printrows(ans)

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()))
l=list(map(int,input().split()))
for i in range(N-K):
   if l[i] < l[i+K]:
      print("Yes")
   else:
      print("No")

Submission status: Accepted

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

for A0, A1 in zip(A, A[K:]):
    if A1 > A0:
        print('Yes')
    else:
        print('No')

Submission status: Accepted

Solution code:
N, K = input().split()
N = int(N)
K = int(K)
a = input().split()
A = [int(u) for u in a]
for i in range(0, N):
	if i >= K:
		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()))

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

in_n = lambda: int(readline())
in_nn = lambda: map(int, readline().split())
in_s = lambda: readline().rstrip().decode('utf-8')
in_nl = lambda: list(map(int, readline().split()))
in_nl2 = lambda H: [in_nl() for _ in range(H)]
in_map = lambda: [s == ord('.') for s in readline() if s != ord('\n')]
in_map2 = lambda H: [in_map() for _ in range(H)]
in_all = lambda: map(int, read().split())


def main():

    N, K = in_nn()
    A = in_nl()

    for i in range(K, N):
        if A[0 + 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+1, n+1):
    a = i-k-1
    b = i-1
    if A[a] >= A[b]:
        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):
    now=k+i
    if A[now-k]<A[now]:
        print('Yes')
    else:
        print('No')

Submission status: Accepted

Solution code:
import sys


def main():
    input = sys.stdin.buffer.readline
    n, k = map(int, input().split())
    a = [1] + list(map(int, input().split()))
    for i in range(k + 1, n + 1):
        print("Yes" if a[i] > a[i - k] else "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 (N-K):
    if A[i] < A[i+K]:
        print("Yes")
    else:
        print("No")

Submission status: Accepted

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

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

main()

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:
def main():
    n,k = map(int,input().split())
    a = list(map(int,input().split()))
    ans = []
    for i in range(n-k):
        if a[i]<a[i+k]:
            ans.append('Yes')
        else:
            ans.append('No')
    for i in range(len(ans)):
        print(ans[i])

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(1000000)

import bisect
import math
import collections
import heapq


def solve(N, K, As):
    ans = []
    for i in range(N-K):
        left_a = As[i]
        right_a = As[i+K]
        if left_a < right_a:
            ans.append("Yes")
        else:
            ans.append("No")

    return "\n".join(ans)


if __name__ == "__main__":
    N, K = tuple(map(int, input().split(" ")))
    As = list(map(int, input().split(" ")))
    print(solve(N, K, As))

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())
As = list(map(int, input().split()))

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

Submission status: Accepted

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

    for i in range(N-K):
        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()))

buff = []
mul = 1
# for i in range(k):
	# mul *= a[i]
# last = mul
for i in range(k, n):
	if a[i] > a[i-k]:
		buff.append("Yes")
	else:
		buff.append("No")
print('\n'.join(buff))

Submission status: Accepted

Solution code:
import numpy as np
#import math
#from decimal import *
#from numba import njit

#@njit
def main():
    N,K = map(int, input().split())
    A = np.array(list(map(int, input().split())))
    for b in (A[:N-K] < A[K:]):
        print('Yes' if b else 'No')
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-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:
def main():
    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")


main()

Submission status: Accepted

Solution code:
import sys


def _ia(): return map(int, sys.stdin.readline().strip().split())


def main():
    n, k = _ia()
    a = list(_ia())
    return "\n".join(map(lambda x: "Yes" if x > 0 else "No",
                         (a[k+i] - a[i] for i in range(n-k))))


if __name__ == "__main__":
    print(main())

Submission status: Accepted

Solution code:
import numpy as np

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

a = np.array(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 sys
# input = sys.stdin.readline

def mp(): return map(int, input().split())
def lmp(): return list(map(int, input().split()))

n,k = mp()
a = lmp()
for i in range(n-k):
    l = a[i]
    r = a[i+k]
    if r > l:
        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[k+i]:
        print("Yes")
    else:
        print("No")

Submission status: Accepted

Solution code:
import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")


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[i]<a[k+i]:
        ans[i] = "Yes"
    else:
        ans[i] = "No"
write("\n".join(map(str, ans)))

Submission status: Accepted

Solution code:
#!/usr/bin/env pypy3

from sys import stdin, stdout
 
def input():
    return stdin.readline().strip()

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

for i in range(N-K):
    a = A[i]
    b = A[i+K]

    if b > a:
        print("Yes")
    else:
        print("No")

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
n, k, *a = map(int, open(0).read().split())
for i in range(n - k):
    print("YNeos"[a[i] >= a[i + k]::2])

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 sys
stdin = sys.stdin
sys.setrecursionlimit(10**6)
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nn = lambda: list(stdin.readline().split())
ns = lambda: stdin.readline().rstrip()

n,k = na()
a = na()

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

Submission status: Accepted

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


def readstr():
    return input().strip()


def readint():
    return int(input())


def readnums():
    return map(int, input().split())


def readstrs():
    return input().split()


def main():
    N, K = readnums()
    A = list(readnums())
    for i in range(K, N):
        if A[i] > A[i - K]:
            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(N-K):
  if A[i]<A[i+K]:
    print('Yes')
  else:
    print('No')

Submission status: Accepted

Solution code:
import sys
import numpy as np
import math  # gcdもあるよ
from collections import deque
from collections import defaultdict
from copy import deepcopy
from itertools import accumulate #リストを与えると累積和を返す
def input(): return sys.stdin.readline().rstrip()
from functools import lru_cache #メモ化

def main():
    n, k = list(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")   
    return 0

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
def main():

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

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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
from math import log

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

Submission status: Accepted

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

f = True
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().rstrip().split(" "))
A = list(map(int,input().rstrip().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")
    elif a[i] <= a[i-k]:
        print("No")

Submission status: Accepted

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] / p/] / pro[i+ 1]
        if nums[i] < nums[i+k]:
            print("Yes")
        else:
            print("No")
if __name__ == "__main__":
    # main()
    solve()

Submission status: Accepted

Solution code:
import re
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
import functools
def v(): return input()
def k(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7
cnt = 0
ans = 0
inf = float("inf")

n,k=I()
a = l()

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 = list(map(int, input().split()))

for i in range(N-K):
    if A[K+i] > 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()))
score=1
for i in range(0,n-k):
  if a[i]<a[i+k]:
    print('Yes')
  else:
    print('No')

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
N, K = map(int, input().split())
a = list(map(int, input().split()))
for l in range(N - K):
  r = l + K
  if a[l] < a[r]: 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):
  h = a[i]
  f = a[i+k]
  if h<f:
    print("Yes")
  else:
    print("No")

Submission status: Accepted

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

prev = dat[0]

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

Submission status: Accepted

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

for i in range(N-K):
    if A[K+i] <= A[i]:
        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(k,n):
    
    if a[i] > a[i-k]:
        print("Yes")

    else:
        print("No")