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:
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")

Submission status: Time Limit Exceeded

Solution code:
N, K = map(lambda x: int(x), input().split(" "))
As = list(map(lambda x: int(x), input().split(" ")))

multi = 1
pre_multi = 1

for i in range(len(As)):
    multi *= As[i]
    if i >= K-1:
        multi /= As[i-K]
    if i >= K:
        if multi > pre_multi:
            print("Yes")
        else:
            print("No")

    pre_multi = multi

Submission status: Time Limit Exceeded

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

for i in range(k):
    keep *= A[i]


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

Submission status: Time Limit Exceeded

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

s = 1
for i in range(k):
    s *= li[i]

for i in range(k, n):
    t = 1
    for j in range(k):
        t *= li[i+j-k+1]

    if s < t:
        print('Yes')
    else:
        print('No')
        
    s = t

Submission status: Time Limit Exceeded

Solution code:

#!/usr/bin/python
# -*- coding: utf-8 -*-

import numpy as np

def int_mtx(N):
    x = []
    for _ in range(N):
        x.append(list(input()))
    return np.array(x)

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

past = 1
now = 1


for j in range(0,K):
    past = past*A[j]

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

Submission status: Time Limit Exceeded

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

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

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

Submission status: Time Limit Exceeded

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

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

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

Submission status: Time Limit Exceeded

Solution code:
from functools import reduce
N, K = map(int, input().split())

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

before = reduce(lambda a, b: a * b, A[:K])
for i in range(1, N - K + 1):
    temp = reduce(lambda a, b: a * b, A[i:i + K])
    if temp > before:
        print("Yes")
    else:
        print("No")
    before = temp

Submission status: Time Limit Exceeded

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

    tmp = 1
    for i in a[:k]:
        tmp *= i

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

if __name__ == "__main__":
    resolve()

Submission status: Time Limit Exceeded

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

pre = 0
for i in range(n-k+1):
    tmp = 1
    for j in range(k):
        tmp*=A[i+j]
    if i>0:
        if pre<tmp:
            print('Yes')
        else:
            print('No')
    pre = tmp

Submission status: Time Limit Exceeded

Solution code:
import sys
input=sys.stdin.readline
n,k=map(int,input().split())
arr=list(map(int,input().split()))
prev=1
for i in range(k):
    prev*=arr[i]
ans=[]
for i in range(k,n):
    if(prev<prev*arr[i]/arr[i-k]):
        print('Yes')
    else:
        print('No')
    prev=prev*arr[i]/arr[i-k]

Submission status: Time Limit Exceeded

Solution code:
import sys, re
from math import ceil, floor, sqrt, pi, factorial, gcd
from copy import deepcopy
from collections import Counter, deque
from heapq import heapify, heappop, heappush
from itertools import accumulate, product, combinations, combinations_with_replacement
from bisect import bisect, bisect_left, bisect_right
from functools import reduce
from decimal import Decimal, getcontext
# input = sys.stdin.readline 
def i_input(): return int(input())
def i_map(): return map(int, input().split())
def i_list(): return list(i_map())
def i_row(N): return [i_input() for _ in range(N)]
def i_row_list(N): return [i_list() for _ in range(N)]
def s_input(): return input()
def s_map(): return input().split()
def s_list(): return list(s_map())
def s_row(N): return [s_input for _ in range(N)]
def s_row_str(N): return [s_list() for _ in range(N)]
def s_row_list(N): return [list(s_input()) for _ in range(N)]
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 6)
INF = float('inf')
MOD = 10 ** 9 + 7
num_list = []
str_list = []

def main():
    n, k = i_map()
    num_list = i_list()

    ans_list = []
    tmp = 1
    after_score = num_list[0]
    for i in range(k):
        tmp *= num_list[i]

    ans_list.append(tmp)

    for i in range(n-k):
        ima = tmp / after_score
        ima *= num_list[i+k]
        after_score = num_list[i+1]
        
        if ima > tmp:
            print('Yes')
        else:
            print('No')
        tmp = ima



if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

Solution code:
n,k=map(int,input().split())
a=list(map(int,input().split()))
#まずk学期までの
p=1
for i in range(k):
    p*=a[i]
#print(p)
j=0

for i in range(n-k):
    tmp=p
    p//=a[j]
    p*=a[i+k]
    #print(p)
    if p>tmp:
        print("Yes")
    else:
        print("No")
    j+=1

Submission status: Time Limit Exceeded

Solution code:
#!/usr/bin/env python3
import sys
from collections import deque

YES = "Yes"  # type: str
NO = "No"  # type: str


def solve(N: int, K: int, A: "List[int]"):

    A = deque(A)
    a = deque()

    p = 1
    for i in range(K):
        t=A.popleft()
        p*=t
        a.append(t)
    
    for i in range(K, N):
        pre = p
        t = A.popleft()
        p = p // a.popleft() * t
        if p > pre: print(YES)
        else: print(NO)
        pre = p
        a.append(t)

    return


# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    K = int(next(tokens))  # type: int
    A = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, K, A)

if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

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

scores = []


temp = gakki[0]
for i in range(1,K):
    temp *= gakki[i]
scores.append(temp)

for i in range(N - K):
    scores.append(int(scores[i] / gakki[i] * gakki[K + i]))
    

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

Submission status: Time Limit Exceeded

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees, log2, gcd
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def TUPLE(): return tuple(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7 
#mod = 998244353
from decimal import *
#import numpy as np
#decimal.getcontext().prec = 10

N, K = MAP()
A = LIST()

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

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

Submission status: Time Limit Exceeded

Solution code:
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(k,n):
    now = (tmp/a[i-k])*a[i] 
    if now > tmp:
        print("Yes")
    else:
        print("No")
    tmp = now

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
n, k, *A = map(int, open(0).read().split())
s = 1
for a in A[:k]:
    s *= a
B = [s]
for i in range(k, n):
    s *= A[i]
    s //= A[i-k]
    B.append(s)

for b0, b1 in zip(B, B[1:]):
    if b0 < b1:
        print('Yes')
    else:
        print('No')

Submission status: Time Limit Exceeded

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

for i in range(K, N):
    sum_a = 1
    sum_b = 1
    for j in range(K):
        sum_a *= A[i - K + j]
    for j in range(K):
        sum_b *= A[i - K + j + 1]
    if sum_a < sum_b:
        print("Yes")
    else:
        print("No")

Submission status: Time Limit Exceeded

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

now = a[0]
idx = 0
gabbege = a[idx]
length = 1
for i in range(1, n):
    if length < k:
        length += 1
        now *= a[i]
    else:
        if now < now // gabbege * a[i]:
            print("Yes")
        else:
            print("No")
        now = now // gabbege * a[i]
        idx += 1
        gabbege = a[idx]

Submission status: Time Limit Exceeded

Solution code:
import os, sys, atexit
from io import BytesIO, StringIO
 
input = BytesIO(os.read(0, os.fstat(0).st_size)).readline
_OUTPUT_BUFFER = StringIO()
sys.stdout = _OUTPUT_BUFFER
 
@atexit.register
def write():
    sys.__stdout__.write(_OUTPUT_BUFFER.getvalue())
n, k = map(int, input().split())
l = list(map(int, input().split()))
ans = [0] * (n - k + 1)
x = 0
for i in range(1, n):
    l[i] *= l[i - 1]
for i in range(k - 1, n):
    if i == k - 1:
        ans[x] = l[i]
        x -= -1
    else:
        ans[x] = l[i] // l[i - k]
        x -= -1
for i in range(1, len(ans)):
    if ans[i] > ans[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()))

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

C = c
for i in range(0, N - K):
    c //= A[i]
    c *= A[K + i]

    if c > C:
        print("Yes")
    else:
        print("No")
    C = c

Submission status: Time Limit Exceeded

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

a = list(map(lambda x: x - ma + 1, a))

befscore = 1
score = 1
f = True
for i in range(n):
    score = score * a[i]

    if i >= k:
        score = int(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()))

scores = []
s = 1
for j in range(K):
    s *= A[j]

for i in range(N-K+1):
    scores.append(s)
    if i == N-K:
        break
    s = s // A[i]
    s *= A[K+i]

for i in range(len(scores)-1):
    if scores[i+1] > scores[i]:
        print('Yes')
    else:
        print('No')

Submission status: Time Limit Exceeded

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

st = 1 #k楽器
for i in range(k):
    st *= a[i]

j=1
ten = 1
for i in range(k+1,n+1):
    for l in range(j,i):
        ten *= a[l]
    if st < ten:
        print('Yes')
    else:
        print('No')
    j +=1
    st = ten
    ten = 1

Submission status: Time Limit Exceeded

Solution code:
from sys import stdin, stdout
import heapq
import cProfile
from collections import Counter, defaultdict, deque
from functools import reduce
import math
import string

def get_int():
    return int(stdin.readline().strip())


def get_tuple():
    return map(int, stdin.readline().split())


def get_list():
    return list(map(int, stdin.readline().split()))

n,k = get_tuple()
ls = get_list()
i = 0
prod = 1
j = 0
start = ls[j]
while i<k:
    prod *= ls[i]
    i += 1

while i<n:
    oldprod = prod
    prod = int(prod/ls[j])
    prod *= ls[i]
    if oldprod>=prod:
        print("No")
    else:
        print("Yes")

    i += 1
    j += 1

Submission status: Time Limit Exceeded

Solution code:
n, k = map(int, input().split())
li_a = list(map(int, input().split()))
if k == 1:
    for i in range(1, n):
        if li_a[i] > li_a[i-1]:
            print('Yes')
        else:
            print('No')
else:
    li = []
    tmp = 1
    for i in range(k):
        tmp *= li_a[i]
    li.append(tmp)
    for i in range(k, n):
        tmp = tmp // li_a[i-k]
        tmp  *= li_a[i]
        li.append(tmp)
    for i in range(1, n-k+1):
        if li[i] > li[i-1]:
            print('Yes')
        else:
            print('No')

Submission status: Time Limit Exceeded

Solution code:
#import numpy as np
import sys, math
from itertools import permutations, combinations
from collections import defaultdict, Counter, deque
from math import factorial#, gcd
from bisect import bisect_left, bisect_right #bisect_left(list, value)
sys.setrecursionlimit(10**7)
enu = enumerate
MOD = 10**9+7
def input(): return sys.stdin.readline()[:-1]
pl = lambda x: print(*x, sep='\n')

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

B = [0]*(N-K+1)
val = 1
for a in A[:K]:
    val *= a
B[0] = val
for i in range(1, N-K+1):
    B[i] = B[i-1]
    B[i] //= A[i-1]
    B[i] *= A[i+K-1]

for bi, bip in zip(B[:-1], B[1:]):
    if bi < bip:
        print('Yes')
    else:
        print('No')

Submission status: Time Limit Exceeded

Solution code:
from math import sqrt,ceil,gcd
def ii():return int(input())
def si():return input()
def mi():return map(int,input().split())
def li():return list(mi())


# for _ in range(ii()):

n,k=mi()
a=li()
x=[]
ans=1
for i in range(k):
    ans*=a[i]
x=[ans]
for i in range(k,n):
    ans//=a[i-k]
    ans*=a[i]
    x.append(ans)
# print(x)
for i in range(1,len(x)):
    if x[i]>x[i-1]:
        print("Yes")
    else:
        print("No")

Submission status: Time Limit Exceeded

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

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

if __name__ == '__main__':
    solve()

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
import sys
input = sys.stdin.readline
#N, K = (int(i) for i in input().split())
#B = [int(x) for x in input().split()]
#A = [[int(i) for i in input().split()] for i in range(N)]

N, K = (int(i) for i in input().split())
A = [int(x) for x in input().split()]

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

pre = cur*A[K-1] 
cur = pre

#print(pre)
count = 0
for i in range(K, N):
    cur = cur//A[count] * A[i]
    #print(cur)
    if pre < cur:
        print("Yes")
    else:
        print("No")
    pre = cur
    count += 1

Submission status: Time Limit Exceeded

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

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

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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


for gakki in range(k+1,n+1):
    pre = A[gakki-k-1:gakki-1]
    #pre_ = 1
    #for p in pre:
        #pre_ *= p

    
    k_gakki = A[gakki-k:gakki]
    #k_gakki_ = 1
    #for ga in k_gakki:
        #k_gakki_ *= ga
    
    #if pre_ < k_gakki_:
    if sum(pre)< sum(k_gakki):
        print('Yes')
    else:
        print('No')

Submission status: Time Limit Exceeded

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

prev = 1
for i in range(k):
    prev *= a[i]
old = 0

for i in range(k, n):
    score = prev*a[i] / a[old]
    if score <= prev:
        print('No')
        #exit()
    else:
        print('Yes')
    prev = score
    old += 1

Submission status: Time Limit Exceeded

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

num = 1
for i in range(n):
    pre_num = num
    num *= a[i]
    if i >= k:
        num /= a[i-k]
    if i >= k and num > pre_num:
        print('Yes')
    elif i >= k and num <= pre_num:
        print('No')

Submission status: Time Limit Exceeded

Solution code:
def resolve():
    from collections import deque
    N, K = [int(i) for i in input().split()]
    A = [int(i) for i in input().split()]
    sA = 1
    s = deque()
    for i in range(K):
        s.append(A[i])
        sA *= A[i]
    tmp = sA
    for i in range(K, N):
        sA //= s.popleft()
        s.append(A[i])
        sA *= A[i]
        if tmp < sA:
            print("Yes")
        else:
            print("No")
        tmp = sA


resolve()

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

pa = 1
for i in range(k):
    pa *= A[i]

for kk in range(k, n):
    ppa = pa*A[kk]//A[kk-k]
    if ppa > pa:
        print('Yes')
    else:
        print('No')
    pa = ppa

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

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


for i in range(K, N):
    before = score
    score = score * A[i] // A[i-K]

    if before < score:
        print("Yes")
    else:
        print("No")

Submission status: Time Limit Exceeded

Solution code:
import sys
sys.setrecursionlimit(10 ** 9)
# input = sys.stdin.readline    ####
def int1(x): return int(x) - 1
def II(): return int(input())
def MI(): return map(int, input().split())
def MI1(): return map(int1, input().split())
def LI(): return list(map(int, input().split()))
def LI1(): return list(map(int1, input().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def MS(): return input().split()
def LS(): return list(input())
def LLS(rows_number): return [LS() for _ in range(rows_number)]
def printlist(lst, k=' '): print(k.join(list(map(str, lst))))
INF = float('inf')
# from math import ceil, floor, log2
# from collections import deque
# from itertools import combinations as comb, combinations_with_replacement as comb_w, accumulate, product, permutations
# from heapq import heapify, heappop, heappush
# import numpy as np    # cumsum
# from bisect import bisect_left, bisect_right

def solve():
    N, K = MI()
    A = LI()

    B = [1] * N
    B[0] = A[0]
    for i in range(1, N):
        B[i] = B[i-1] * A[i]
    # print(B)

    B = [1] + B

    for i in range(K+1, N+1):
        tmp = B[i] / B[i-K]
        tmp2 = B[i-1] / B[i-1-K]
        # print(tmp, tmp2)
        if tmp > tmp2:
            print('Yes')
        else:
            print('No')


if __name__ == '__main__':
    solve()

Submission status: Time Limit Exceeded

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

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

# print(fir)

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

Submission status: Time Limit Exceeded

Solution code:
import sys
read = sys.stdin.read
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7


def main():
    N, K = map(int, readline().split())
    A = list(map(int, readline().split()))
    X = 1
    for i in range(K):
        X *= A[i]
    B = [X]
    for i in range(K,N):
        tmp = B[-1] * A[i] // A[i-K]
        B.append(tmp)

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



if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

Solution code:
n,k=map(int,input().split())
a=list(map(int,input().split()))
s=sum(a[:k])
for i in range(n-k):
	t=sum(a[i+1:k+i+1])
	print('YNeos'[s>=t::2])
	s=t

Submission status: Time Limit Exceeded

Solution code:
N, K = 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
    score /= A[i - K]
    score *= A[i]
    if int(score) > tmp:
        print("Yes")
    else:
        print("No")

Submission status: Time Limit Exceeded

Solution code:
# -*- coding: utf-8 -*-
import sys
import math
from bisect import bisect_left
from bisect import bisect_right
from collections import defaultdict
from heapq import heappop, heappush
import itertools
import random
from collections import deque
from decimal import *
import queue

input = sys.stdin.readline

def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))
def inputStr(): return input()[:-1]

inf = float('inf')
mod = 1000000007

#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-

def main():
	N,K = inputMap()
	A = inputList()

	ans = 1
	ans_old = 1
	mae = 0
	for i,val in enumerate(A):
		if i < K:
			ans_old *= val
			continue

		mae = A[i-K]
		ans = ans_old
		ans = ans / mae * val
		if ans > ans_old:
			print("Yes")
		else:
			print("No")
		ans_old = ans


#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
if __name__ == "__main__":
	main()

Submission status: Time Limit Exceeded

Solution code:
from sys import stdin
N,K = [int(x) for x in stdin.readline().rstrip().split()]
A = [int(x) for x in stdin.readline().rstrip().split()]

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

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

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

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

Submission status: Time Limit Exceeded

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

points = []

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

points.append(p)
for i in range(n-k):
    p = p * a[i+k] // a[i]
    points.append(p)

for p,n in zip(points, points[1:]):
    if p < n:
        print('Yes')
    else:
        print('No')

Submission status: Time Limit Exceeded

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

    score = 1
    for _a in a[:k]:
        score *= _a

    for i, _a in enumerate(a[k:]):
        if score < (score * _a / a[i]):
            print("Yes")
        else:
            print("No")
        score = score * _a / a[i]
    
    return


if __name__ == "__main__":
    main()

Submission status: Time Limit Exceeded

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

value = 1
for i in range(k):
    value = value * alis[i]

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

Submission status: Time Limit Exceeded

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

t = 1
for i in range(K):# A[0] ~ A[K-1]
  t *= A[i]
  
for i in range(K, N):
  temp = t // A[i-K] * A[i]
  if t < temp:
    print('Yes')
  else:
    print('No')
  t = temp

Submission status: Time Limit Exceeded

Solution code:
### ----------------
### ここから
### ----------------

import sys
from io import StringIO
import unittest

def yn(b):
    print("Yes" if b==1 else "No")
    return

def resolve():
    readline=sys.stdin.readline

    n,k=map(int, readline().rstrip().split())
    arr=list(map(int, readline().rstrip().split()))
    
    score=1
    for i in range(n):
        score*=arr[i]
        if (i+1) > k:
            score = score//arr[i-k]
            if score > bef:
                print("Yes")
            else:
                print("No")
        bef=score

    return

if 'doTest' not in globals():
    resolve()
    sys.exit()

### ----------------
### ここまで 
### ----------------

Submission status: Time Limit Exceeded

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

sm=1
sm_lst=[]
for i in range(n):
    sm*=a[i]
    if i>=k:
        sm//=a[i-k]
        if sm > sm_lst[i-1]:
            print("Yes")
        else:
            print("No")
    sm_lst.append(sm)

Submission status: Time Limit Exceeded

Solution code:
import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    N, K = LI()
    A = LI()

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

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

if __name__ == '__main__':
    resolve()

Submission status: Time Limit Exceeded

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


if __name__ == "__main__":
    main()

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

b = []
tmp = 1

for i in range(n):
    tmp *= a[i]
    if i >= k:
        tmp //= a[i-k]
    if i >= k-1:
        b.append(tmp)

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