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 sys
from itertools import accumulate
import operator as op
input = sys.stdin.readline

n,k=map(int,input().split())
L=list(map(int,input().split()))
N=[1]+list(accumulate(L,op.mul))

ans=[]
for i in range(k,n+1):
    val = N[i]/N[i-k]
    ans.append(val)

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

Submission status: Time Limit Exceeded

Solution code:
from collections import deque
from functools import reduce
from operator import mul

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

before = None
for section in range(K, N + 1):
    if before is None:
        target_test_points = test_points[section - K : section]
        before = reduce(mul, target_test_points)
        continue
    point = (before // test_points[section - K - 1]) * test_points[section - 1]
    if before < point:
        print("Yes")
    else:
        print("No")
    before = point

Submission status: Time Limit Exceeded

Solution code:
n, k = map(int, input().rstrip().split())
arr = list(map(int, list(input().split())))
sum_ = list()
tmp = -1
mul = 1
c = 0
for a in arr:
  mul *= a
  c += 1
  if c >= k:
    sum_.append(mul)
    mul //= arr[c-k]

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

Submission status: Time Limit Exceeded

Solution code:
#!/usr/bin/env python3
# スペース区切りの整数の入力
n, k = map(int, input().split())
#配列の入力
data = list(map(int, input().split()))

temp = 1
old = 1
for i in range(n):
    if i < k:
        temp *= data[i]
        continue
    else:
        old = temp
        temp = temp / data[i-k] * data[i]
    #print("i:{}, k:{}".format(i, k))
    #print(score)

    if i > k-1:
        if temp > old:
            print("Yes")
        else:
            print("No")

Submission status: Time Limit Exceeded

Solution code:
from sys import stdin


def readline_from_stdin() -> str:
    return stdin.readline().rstrip


if __name__ == '__main__':
    N, K, = input().split()
    A = [int(i) for i in input().split()]
    N, K = int(N), int(K)

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

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

    # scores = [score]
    # for i in range(N-K):
    #     print(i, K+i)
    #     score = int(score / A[i]) * A[K+i]
    #     scores.append(score)
    #
    # print(scores)
    #
    # results = [False for i in range(len(scores)-1)]
    #
    # for i in range(len(scores)-1):
    #     results[i] = scores[i+1] > scores[i]
    #
    # [print("Yes") if r else print("no") for r in results]

Submission status: Time Limit Exceeded

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

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

for i in range(N - K):
  list_a = list(A[i:i+K])
  list_b = list(A[i+1:i+K+1])
  list_a.sort()
  list_b.sort()
  if list_a < list_b:
    print("Yes")
  else:
    print("No")

Submission status: Time Limit Exceeded

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

n,k = map(int,input().split())
a_list = [int(i) for i in input().split()]

prev_point = 1
for i in range(k) :
    prev_point *= a_list[i]


for i in range(k+1,n+1) :
    # print(i-k,i-1)
    current_point = ((prev_point // a_list[i-k-1]) * a_list[i-1])
    # print(prev_point,current_point)
    if (prev_point < current_point) :
        print("Yes")
    else :
        print("No")
    prev_point = current_point

Submission status: Time Limit Exceeded

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

before = -1
for i in range(k, n+1):
  sp = 1
  for j in range(k):
    sp *= a[i-j-1]
  if before == -1:
    before = sp
  else:
    if sp > before:
      print("Yes")
    else:
      print("No")
    before = sp

Submission status: Time Limit Exceeded

Solution code:
import functools
import operator
prod = functools.partial(functools.reduce, operator.mul)

listS = []

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

for i in range(0,N-K+1):
    listS.append(prod(A[i:K+i]))
    
for j in range(len(listS)-1):
    if listS[j] < listS[j+1]:
        print("Yes")
    else:
        print("No")

Submission status: Time Limit Exceeded

Solution code:
#標準入力
N,K = map(int,input().split())
lst = list(map(int,input().split()))

from operator import mul
from functools import reduce

# チェック回数
n=N-K

point_lst=[]

for i in range(n+1):
    slice_list = lst[i:(i+K)]
    point_lst.append(slice_list)

for j in range(len(point_lst)-1):
    print('Yes') if (reduce(mul, point_lst[j])) < (reduce(mul, point_lst[j+1])) else print('No')

Submission status: Time Limit Exceeded

Solution code:

n,k = map(int,input().split())
A = list(map(int,input().split()))
b=[]
s=0
for x in range(n-k+1):
    c=A[s:k+s:1]
    s+=1
    d=1
    for y in c:
      d=d*y
    b.append(d)
q=0
for z in range(n-k):
  if b[q]<b[q+1]:
    print("Yes")
  else:
    print("No")
  q+=1

Submission status: Time Limit Exceeded

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

x = 1
ll = [1]
for i in l:
    x *= i
    ll.append(x)

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

Submission status: Time Limit Exceeded

Solution code:
import itertools

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

score_before = 1
score = 1
for i in range(N):
    if i >= K:
        for j in range(K):
            score *= A[i - j]
            score_before *= A[i - j- 1]
        if(score > score_before):
            print("Yes")
        else:
            print("No")
        score = 1
        score_before = 1

Submission status: Time Limit Exceeded

Solution code:
n, k = map(int, input().split())
a = list(map(int, input().split()))
dp = [1]
for i in range(1, n+1):
    if i < k:
        dp.append(1)
    elif i == k:
        x = 1
        for j in range(1, k+1):
            x *= a[i-j]
        dp.append(x)

    else:
        dp.append(dp[i-1] // a[i-k-1] * a[i-1])

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

Submission status: Time Limit Exceeded

Solution code:
nk = input().split()
n = int(nk[0])
k = int(nk[1])
a = list(map(int, input().split()))

p = [0] * n
for i in range(k - 1, n):
    if i == k - 1:
        p_i = 1
        for j in range(k):
            p_i *= a[i - j]
        p[i] = p_i
    else:
        p[i] = int(p[i - 1] / a[i - k] * a[i])

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

Submission status: Time Limit Exceeded

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

latest_score = 0
before_score = 0

for cnt_k in range(k):
    if latest_score == 0:
        latest_score = a[cnt_k]
    else:
        latest_score *= a[cnt_k]

for cnt in range(1, n - k + 1):
    before_score = latest_score
    latest_score /= a[cnt-1]
    # latest_score = int(latest_score)
    latest_score *= a[cnt + k - 1]

    if before_score < latest_score:
        print('Yes')
    else:
        print('No')

Submission status: Time Limit Exceeded

Solution code:
N, K = map(int,input().split())
A = list(map(int,input().split()))
lscore = []
score = 1
for j in range(K):
    score *= A[j]
lscore.append(score)
for i in range(K+1,N+1):
        score = score*A[i-1]/A[i-K-1]
        lscore.append(score)
        if lscore[i-K] > lscore[i-1-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()))
for i in range(K,N):
  X=1
  Y=1
  for I in range(0,K):
    X*=A[i-I]
    Y*=A[i-I-1]
  print('Yes' if X>Y else "No")

Submission status: Time Limit Exceeded

Solution code:
import numpy as np
N,K = map(int, input().split())
As = list(map(int, input().split())) 
A=np.array(As)
for x in range(N-K):
  if np.mean(A[x:K+x]) < np.mean(A[x+1:K+x+1]):
    print("Yes")
  else:
    print("No")

Submission status: Time Limit Exceeded

Solution code:
import sys
from operator import mul
from functools import reduce


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

tests = A[: K]
score = reduce(mul, tests)
this_term = score / A[0]
for i in range(K, N):
    this_term *= A[i]
    if score < this_term:
        print("Yes")
    else:
        print("No")
    score = this_term
    this_term /= A[i - K + 1]

Submission status: Time Limit Exceeded

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

t = sum(lis[:k])

 
for i in range(k, n):
    a = sum(lis[i-k+1:i+1])
    
    if a > t:
        print('Yes')
    else:
        print('No')
    
    t = a
    a = 0

Submission status: Time Limit Exceeded

Solution code:
from collections import defaultdict
n,k = map(int, input().split())
a = list(map(int, input().split()))
ans = defaultdict(int)
temp = 1
maxArr = n - k
for i in range(maxArr + 1):
  for j in range(k):
    temp *= a[j + i]
  ans[i] = temp
  temp = 1

for i in range(maxArr):
  if(ans[i] < ans[i + 1]):
    print ('Yes')
  else:
    print('No')

Submission status: Time Limit Exceeded

Solution code:
from functools import reduce
from operator import mul
n,k = list(map(int, (input().split())))
a = list(map(int, (input().split())))
bkresult = 0
result = 1

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

Submission status: Time Limit Exceeded

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

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

b = [1]
c = 1

for i in range(n):
    c = c * a[i]
    b.append(c)

for j in range(k,n):
    if b[j+1]/b[j+1-k] - b[j]/b[j-k] > 0:
        print('Yes')
    else:
        print('No')

Submission status: Time Limit Exceeded

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

score = []
for i in range(len(A)-K+1):
    score.append(functools.reduce(operator.mul, (A[i:K+i])))

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

Submission status: Time Limit Exceeded

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

for j in range(k):
    b *= a[j]

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

Submission status: Time Limit Exceeded

Solution code:
def main(): 
  n,k =[int(x) for x in input().split()]
  arr = [int(x) for x in input().split()] 
  product =1
  for i in range(0,k+1):
    product = product*arr[i];
    # print(product)
  for i in range(0,n-k):
    if product * arr[k + i] / arr[i] > product:
      print("Yes")
      product = product * arr[k + i] / arr[i]
    else:
      print("No")
      product = product * arr[k + i] / arr[i]
if __name__ == "__main__": 
    main()

Submission status: Time Limit Exceeded

Solution code:
from operator import mul
from functools import reduce

[n,k] = map(int, input().split(' '))
A = list(map(int, input().split(' ')))

def hyoka(j,p,b_point):
  if j == k:
    point = reduce(mul, A[0:j])
    return point
  else:
    point = b_point/A[j-k-1]*p
    
  if b_point < point:
    print('Yes')
  else:
    print('No')
  return point
b_point = 0
for i,p in enumerate(A):
  if i+1 < k:
    continue
  result = hyoka(i+1,p,b_point)
  if result > 0:
  	b_point = result

Submission status: Time Limit Exceeded

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

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

    for i in range(1, N - K + 1):
        for j in range(i, i + K):
            tmp2 *= A[j] 
        if tmp1 < tmp2:
            print('Yes')
        else:
            print('No')
        tmp1 = tmp2
        tmp2 = 1
main()

Submission status: Time Limit Exceeded

Solution code:
import bisect,collections,copy,heapq,itertools,math,string
import sys
from collections import deque
def S(): return sys.stdin.readline().rstrip()
def M(): return map(int,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
n, k = M()
A = deque(LI())
ans = deque()
for i in range(n-1, k-1, -1):
    if A[i] > A[i-k]:
        ans.appendleft('Yes')
    else:
        ans.appendleft('No')
for s in ans:
    print(s)

Submission status: Time Limit Exceeded

Solution code:
# 2020/07/25
# M-SOLUTIONS プロコンオープン 2020 - C

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

# Calc
pt = a[0]

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

for i in range(k, n):
    bef_pt = pt
    pt = pt * a[i] // a[i-k] 

    # Output
    if bef_pt < pt:
        print('Yes')
    else:
        print('No')

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

scores = []

score = 1
for i in range(k-1, -1, -1):
    score *= a[i]

scores.append(score)

for j in range(k, n):
    scores.append(scores[-1] * a[j] / a[j-k])
    if scores[-1] > scores[-2]:
        print('Yes')
    else:
        print('No')

Submission status: Time Limit Exceeded

Solution code:
from math import floor,ceil,sqrt,factorial,log
from collections import Counter, deque
from functools import reduce
import numpy as np
import itertools
def S(): return input()
def I(): return int(input())
def MS(): return map(str,input().split())
def MI(): return map(int,input().split())
def FLI(): return [int(i) for i in input().split()]
def LS(): return list(MS())
def LI(): return list(MI())
def LLS(): return [list(map(str, l.split() )) for l in input()]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def LLSN(n: int): return [LS() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]

N,K = MI()

A = LI()

multi = {}

start = 1
for k in range(0,K):
    start = start * A[k]

for j in range(K, N+1):
    if j == K:
        multi[j] = start
        continue
    start = start // A[j-K-1] * A[j-1]
    multi[j] = start

    if j-1 in multi:
        if multi[j] > multi[j-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()))

Hyoten = [0] * (N-K+1)

for i in range(K,N+1):
  Hyoten[i-K] = 1
  for j in range(i-K,i):
    Hyoten[i-K] *= A[j]

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

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

Solution code:
N,K = map(int, input().split())
A = list(map(int, input().split()))
i = N - K
while i > 0:
    print('Yes' if A[K] > A[0] else 'No')
    A.pop(0)
    i -= 1

Submission status: Time Limit Exceeded

Solution code:
n,k=map(int,input().split( ))
m=0
a=list(map(int ,input().split( )))
num1=1
num2=1
b=[]
for i in range(m,k):
    num1*=a[i]
num2=num1
while(k<n):
    num1=int(num1*a[k]/a[m])
    if(num1>num2):
        print("Yes")
    else:
        print("No")
    m+=1
    num2=num1
    if(k<n):
        k+=1
    else:
        break

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
N,K = [int(i) for i in input().split(' ')]
marks = [int(i) for i in input().split(' ')]
grades = []
for i in range(K-1,N):
    grade = 1
    for j in range(K):
        grade *= marks[i-j]
    grades.append(grade)
for i in range(N-K):
    if grades[i]<grades[i+1]:
        print("Yes")
    else : print("No")

Submission status: Time Limit Exceeded

Solution code:
n, k = (int(x) for x in input().split())
a = input().split()

point = []

for j in range(n-k+1):
    temp = int(a[j])
    for i in range(j+1,k+j):
        temp = temp * (int(a[i]))
    point.append(temp)

for i in range(1,n-k+1):

    if(point[i-1] >= point[i]):
        print("No")
    else:
        print("Yes")

Submission status: Time Limit Exceeded

Solution code:
n, k = list(map(int, input().split()))
arr = list(map(int, input().split()))
s = []
f = []

z = 0
c = 1
m = 0
for a in range(k-1,k):
    z = 0
    c = 1
    while z < k:
        c = c * arr[a-z]
        z += 1

    s.append(c)
    
lastkm1 = c//arr[m]
p = 1
for i in range(k,n):
    m += 1
    c = lastkm1*arr[i]
    s.append(lastkm1*arr[i])
    lastkm1 = c//arr[m]
    if s[p]>s[p-1]:
        print("Yes")
    else:
        print("No")
    p+=1

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):
  X=1
  Y=1
  for I in range(0,K):
    X*=A[i-I]
    Y*=A[i-I-1]
  print('Yes' if X>Y else "No")

Submission status: Time Limit Exceeded

Solution code:
a=list(map(int,input().strip().split()))
b=list(map(int,input().strip().split()))
c=[]
for i in range(0,(a[0]-a[1])+1):
  s=1
  for j in range(i,i+a[1]):
    s=s*b[j]
  c.append(s)
for i in range(0,len(c)-1):
  if(c[i]<c[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()))
ans = 1
prev = 1
once = 1
for i in range(k - 1, n):
    prev = ans
    # ans = a[i] * a[i - 1] * a[i - 2]
    ans = 1
    for j in range(i - k + 1, i + 1):
        ans = ans * a[j];
    # print(ans)
    if(once):
        once = 0
    else:
        if(ans > prev):
            print("Yes")
        else:
            print("No")

Submission status: Time Limit Exceeded

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

prev = 0
now = 1
for i in range(n - (k - 1)):
#    print(i)#
    if i ==0:
        for j in a[i: k + i]:
    #        print(j)#
            now *= j
    elif i >= 1:
#        print(a[i - 1], a[k+i-1]) #
#        print(prev,now)#
        now = (prev / a[i - 1]) * a[k+i-1]
#        print(prev,now)#
        if prev >= now:
            print("No")
        else:
            print("Yes")
    prev = now
    now = 1
#    print(prev,now)#

Submission status: Time Limit Exceeded

Solution code:
#!/usr/bin/env python
"""M-SOLUTIONS プロコンオープン 2020: C - Marks
https://atcoder.jp/contests/m-solutions2020/tasks/m_solutions2020_c
"""


def main():
    N, K = list(map(int, input().split()))
    As = list(map(int, input().split()))

    # N, K = [3, 2]
    # As = [1001, 869120, 1001]

    # N, K = [15, 7]
    # As = [3, 1, 4, 1, 5, 9, 2, 6, 5, 3, 5, 8, 9, 7, 9]
    prev_score = 0
    for i in range(N-(K-1)):
        # print('i:{}({})'.format(i, i+K))
        score = 1
        e = i + (K-1)
        s = i + ((K-1)-(K-1))
        # print('  {} => {}'.format(s, e+1))
        for j in range(s, e+1):
            score *= As[j]
        # print('score:{}'.format(score))
        # print('prev_score:{}'.format(prev_score))
        if prev_score == 0:
            prev_score = score
        else:
            # print('{} => {}'.format(prev_score, score))
            if prev_score < score:
                print('Yes')
            else:
                print('No')
            prev_score = score


if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

Solution code:
N, K = map(int, input().split())
A = [int(a) for a in input().split()]
tot1 = 1
tot2 = 1

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

for j in range(N - K):
  tot2 = tot1 * A[j + K] // A[j] 
  if tot2 > tot1:
    print('Yes')
  else:
    print('No')
  tot1 = tot2

Submission status: Time Limit Exceeded

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

result = [0]*n
tmp = 1
for i in range(k):
    tmp *= int(a[i])

result[k-1] =int(tmp)

for i in range(k, n):
    result[i] = int(result[i-1])*int(a[i])//int(a[i-k])
    if result[i-1] < result[i]:
        print('Yes')
    else:
        print('No')

Submission status: Time Limit Exceeded

Solution code:
import functools
import operator

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

prod = functools.partial(functools.reduce, operator.mul)
tmp_sum_prod = prod(A[:K])
for i in range(K, N):
    sum_prod = int(tmp_sum_prod * A[i]/A[i-K])
    if sum_prod > tmp_sum_prod:
        print('Yes')
    else:
        print('No')
    tmp_sum_prod = sum_prod

Submission status: Time Limit Exceeded

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

sum_list = 0
result = 0
for i in range(n - k + 1):
    if i == 0:
        sum_list = sum(a_list[:k])
        result = sum_list
        a_list.remove(a_list[0])
        continue
    sum_list = sum(a_list[:k])
    if sum_list > result:
        print('Yes')
    else:
        print('No')
    result = sum_list
    a_list.remove(a_list[0])

Submission status: Time Limit Exceeded

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

B = 0
s = 1
for i, a in enumerate(A):
    if i < K:
        s *= a
        B = s
    else:
        s /= A[i-K]
        s *= a
        if B != 0 and B < s:
            print('Yes')
        elif B != 0 and B >= s:
            print('No')
        B = s

Submission status: Time Limit Exceeded

Solution code:
N,K = map(int,input().split())
a = list(map(int,input().split()))
t = []; u = 1
for i in range(K):
    u *= a[K-i-1]
t.append(u)
for i in range(1,N-K+1):
    u = u / a[i-1]
    u = u * a[K+i-1]
    t.append(u)
    if t[i-1]<t[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()))
point = 1
for i in range(k):
  point = point*a[i]
#print(point)
t = 0
for j in range(k, n):
  point0 = point
  point = point*a[j]/a[t]
  t+=1
  if point > point0:
    print("Yes")
  else:
    print("No")

Submission status: Time Limit Exceeded

Solution code:

n,k=map(int,input().split())
x=[int(x) for x in input().split()]
ans=[1]*n
ans[0]=x[0]
for i in range(1,k):
  ans[i]=ans[i-1]*x[i]
c=0
for i in range(k,n):
  if x[c]<x[i]:
    print('Yes')
  else:print('No')
  c+=1

Submission status: Time Limit Exceeded

Solution code:
# coding: utf-8
# Your code here!

n,k = map(int, input().split())
a=list(map(int, input().split()))  
count=0
pre_total=0
for i in range(k-1,len(a)) :
    count=1
    
    for j in range(0,k):
        if j == 0:
            count*=a[i]
        else:
            j=i-j
            count*=a[j]
        
        
    if pre_total != 0 :
        if pre_total < count :
            print("Yes")
        else :
            print("No")
        
    pre_total=count

Submission status: Time Limit Exceeded

Solution code:
import sys
n,k=map(int,input().split())
a=list(map(int,input().split()))
sum=[0]*n
sum[0]=a[0]

def input():
    return sys.stdin.readline()[:-1]

def main():
    
    for i in range(1,n):
        sum[i]=sum[i-1]*a[i]
        if i>=k:
            sum[i]/=a[i-k]
    
    # p=[0]*n
    # for i in range(k-1,n):
    #     if i==k-1:
    #         p[i]=sum[i]
    #     else:
    #         p[i]=sum[i]/sum[i-k]


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

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


if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

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

latest_score = 0
before_score = 0

for cnt_k in range(k):
    if latest_score == 0:
        latest_score = a[cnt_k]
    else:
        latest_score *= a[cnt_k]

for cnt in range(1, n - k + 1):
    before_score = latest_score
    latest_score /= a[cnt-1]
    latest_score = int(latest_score)
    latest_score *= a[cnt + k - 1]

    if before_score < latest_score:
        print('Yes')
    else:
        print('No')

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

ans = []
g = 0
for i in range(N-K+1):
  k = 1
  for s in range(K):
    k *= a[s+i] 
  ans.append(k)
  if len(ans)>1:
    if ans[0]<ans[1]:
      print("Yes")
    else:
      print("No")
    del ans[0]

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
N,K = map(int, input().split())
A = list(map(int, input().split()))
while True:
    print('Yes' if A[K] > A[0] else 'No')
    A.pop(0)
    if len(A) == K:
        break

Submission status: Time Limit Exceeded

Solution code:
#!/usr/bin/env python3
# スペース区切りの整数の入力
n, k = map(int, input().split())
#配列の入力
data = list(map(int, input().split()))

temp = 1
old = 1
for i in range(n):
    if i < k:
        temp *= data[i]
    else:
        old = temp
        temp = temp // data[i-k] * data[i]
    #print("i:{}, k:{}".format(i, k))
    #print(score)

    if i > k-1:
        if temp > old:
            print("Yes")
        else:
            print("No")

Submission status: Time Limit Exceeded

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

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

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



for i in range(K,N):

    if hyouten[i] > hyouten[i-1]:
        # print(hyouten[i-1],hyouten[i])
        print("Yes")
    else:
        # print(hyouten[i-1],hyouten[i])
        print("No")

Submission status: Time Limit Exceeded

Solution code:
N,M = map(int,input().split())
a = list(map(int,input().split()))
from collections import deque

d = deque()
for i in range(M-1,N):
  a_num =1
  for j in range(i-M+1,i+1):
    a_num = a_num*a[j]
  d.append(a_num)
  if i>M-1:
    if d[i-M]<d[i-M+1]:
      print("Yes")
    else:
      print("No")

Submission status: Time Limit Exceeded

Solution code:
from math import floor,ceil,sqrt,factorial,log
from collections import Counter, deque
from functools import reduce
import numpy as np
import itertools
def S(): return input()
def I(): return int(input())
def MS(): return map(str,input().split())
def MI(): return map(int,input().split())
def FLI(): return [int(i) for i in input().split()]
def LS(): return list(MS())
def LI(): return list(MI())
def LLS(): return [list(map(str, l.split() )) for l in input()]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def LLSN(n: int): return [LS() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]

N,K = MI()

A = LI()

multi = {}

start = 1
for k in range(0,K):
    start = start * A[k]
for j in range(K, N+1):
    if j == K:
        multi[j] = start
        continue
    start = start // A[j-K-1] * A[j-1]
    multi[j] = start
    
for i in range(K, N+1):
    if i-1 in multi:
        if multi[i] > multi[i-1]:
            print("Yes")
        else:
            print("No")