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:
# coding: utf-8
import math
import numpy
#N = int(input())
N, K = map(int,input().split())
A = list(map(int,input().split()))
#K =int(input())
ANS = []
a = 1
for i in range(K):
    a *= A[K-i-1]
ANS.append(a)
for i in range(K,N):
    a *=A[i]
    a //= A[i-K]
    ANS.append(a)
#print(ANS)
for i in range(N-K):
    if ANS[i+1] > ANS[i]:
        print("Yes")
    else:
        print("No")

Submission status: Time Limit Exceeded

Solution code:
import sys
import math 
def main():
    N,K = map(int,input().split())
    A = list(map(int,input().split()))
    p  = 0
    def mul(A):
        m = 1
        for i in range(len(A)):
            m*=A[i]
        return m
        
    score = []
    for i in range(K-1,N):
        lst = A[i-K+1:i+1]
        p = mul(lst)
        if i != K-1:
            if p <= prev:
                print('No')
            else:
                print('Yes')
        prev = p
    
        

if __name__ == "__main__":
    main()

Submission status: Time Limit Exceeded

Solution code:
N,K = map(int,input().split())
A = list(map(int, input().split()))
sum = 0
last = 0
sw = 0
for num in range(K):
  last += A[num]
for i in range(1,N-K+1):
  for j in range(K):
    sum += A[i+j]
    if last < sum:
      print("Yes")
      sw = 1
      break
  if sw ==0:
    print("No")
  last = sum
  sum = 0
  sw = 0

Submission status: Time Limit Exceeded

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

#hyouten = []

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

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

    
    if i>0:
        score_old = score
        score = score // a[i-1] * a[i+k-1]
        
        if score >score_old:
            print("Yes")
        else:
            print("No")
#    hyouten.append(score)

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

Solution code:
def main(N, K, A):
    for i in range(K-1, N): # 0 から数えるから K-1
        this = 1

        # 総積
        for a in A[i-(K-1):i+1]:   # 直近3学期． i+1はスライスのときその数字は入らないから．
            this *= a

        # print
        if i != K-1:
            if this > before:
                print('Yes')
            else:
                print('No')
        before = this


if __name__ == '__main__':
    N, K = list(map(int, input().split()))
    A = list(map(int, input().split()))
    main(N, K, A)

Submission status: Time Limit Exceeded

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


cur=1
for i in range(0,k) :
    cur = cur * l[i]
for i in range(k,n) : 
    pre = cur
    cur /= l[i-k]
    cur = cur * l[i]
    if(pre < cur) :
        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 = ['No' for i in range(n - k)]

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

for i in range(1, n - k + 1):
    cur = (pre // a[i - 1]) * a[i + k-1]
    if cur > pre:
        ans[i - 1] = 'Yes'

    pre = cur


for i in ans:
    print(i)

Submission status: Time Limit Exceeded

Solution code:
n,k = map(int,input().split())
l = list(map(int,input().split()))
cnt = l[k-1]
p = 1
g = k-1
i = 0
while(i < k-1):
    cnt = cnt*l[g-1]
    g = g-1
    i = i+1

g = g+1
pr = l[g-1]
while(k < n):
    cur = cnt*l[k]
    cur = cur//pr
    g = g+1
    pr = l[g-1]
    if cur > cnt:
        print("Yes")

    else:
        print("No")

    cnt = cur
    k = k+1

Submission status: Time Limit Exceeded

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

old = 0

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

Submission status: Time Limit Exceeded

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

sum = 1
for r in range(n):
    l = r - k
    pre = sum
    sum *= a[r]

    if l < 0:
        continue

    sum /= a[l]
    if pre < sum:
        print("Yes")
    else:
        print("No")

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
n,k=map(int,input().split())
A=list(map(int,input().split()))
lst=[1]*n
for i in range(n):
  if i==0:
    lst[i]=A[i]
  elif 1<=i<=k-1:
    lst[i]=lst[i-1]*A[i]
  else:
    temp=lst[i-1]//A[i-k]
    lst[i]=temp*A[i]
    print("Yes" if lst[i]>lst[i-1] else "No")

Submission status: Time Limit Exceeded

Solution code:
import sys
input = sys.stdin.readline
def main():
    N, K = map(int, input().split())
    A = list(map(int, input().split()))
    tmp = 1
    for i in range(K):
        tmp *= A[i]

    for i in range(K,N):
        n = tmp * A[i] / A[i-K]
        if n > tmp:
            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()))

from operator import mul
from functools import reduce

scores = []
judge_str = {True: "Yes", False: "No"}

for i in range(K, N+1):
    scores.append(reduce(mul, A[i-K:i]))
    if len(scores) == 1:
        continue
    else:
        print(judge_str[scores[i-K-1] < scores[i-K]])

Submission status: Time Limit Exceeded

Solution code:
import math
N,K=map(int,input().split())
A=list(map(int,input().split()))
count=0
before=0
now=1


for i in A:
    now*=i
    count+=1
    if count>K:
        now=now/A[count-K-1]
        if now>before:
            print("Yes")
        else:
            print("No")
    if count>=K:
        before=now

Submission status: Time Limit Exceeded

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

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

before_score = sum(score_list[:K])

M = N-K

if M == 1:
  next_score = sum(score_list[1:K+1])
  if before_score < next_score:
    print("Yes")
  else:
    print("No")

else:
  for i in range(1,M+1):
    next_score = sum(score_list[i:K+i])
    if before_score < next_score:
      print("Yes")
      before_score = next_score
    else:
      print("No")
      before_score = next_score

Submission status: Time Limit Exceeded

Solution code:
def inN():
    return int(input())
def inL():
    return list(map(int,input().split()))

n,k = inL()
a = inL()
sum = 1
sum2 = 1
for i in range(k):
    sum2 *= a[i]
for i in range(k,n):
    #print(sum2)
    sum = 1
    for j in range(i-k+1,i+1):
        sum *= a[j]
    if sum > sum2:
        print('Yes')
    else:
        print('No')
    sum2 = sum

Submission status: Time Limit Exceeded

Solution code:
from functools import reduce

def main():
    n,k = map(int,input().split()) #学期は1-indexed
    scores = [0] + list(map(int,input().split()))
    seiseki = []
    for i in range(k,n+1):
        seiseki.append(reduce(lambda a,b:a*b,scores[i-k+1:i+1]))
    for i,_ in enumerate(seiseki):
        if i == 0:
            continue
        if seiseki[i] > seiseki[i-1]:
            print("Yes")
        else:
            print("No")






if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

Solution code:
import sys
n,k = map(int, sys.stdin.readline().rstrip("\n").split())
a = [int(s) for s in sys.stdin.readline().rstrip("\n").split()]
p = 1
for i in range(k):
    p *= a[i]
for i in range(k,n):
    pnew = p * a[i]
    pnew = pnew // a[i-k]
    if p < pnew:
        print('Yes')
    else:
        print('No')
    p = pnew

Submission status: Time Limit Exceeded

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

ans = [1] * (n-k+1)

for i in range(k):
    ans[0] *= a[i]

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

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 = []
for i in range(N-K+1):
    s = 1
    for j in range(K):
        s *= A[i+j]
    B.append(s)

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

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


beforePoint = reduce(mul, A[:K])

for i in range(0, N-K):
    point = (beforePoint//A[i]) * A[i+K]
    # print(beforePoint, point)
    if beforePoint < point:
        print("Yes")
    else:
        print("No")
    beforePoint = point

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
import sys

def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())

N,K = LI()
A = LI()

hyoten = [1] * (N-K+1)

for i in range(N-K+1):
    for q in range(K):
        hyoten[i] *= A[i+q]


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

Submission status: Time Limit Exceeded

Solution code:
from math import prod
N,K = map(int, input().split())
A = list(map(int, input().split()))
M = prod(A[:K])
while True:
    A.pop(0)
    if len(A) == K - 1:
        break
    P = prod(A[:K])
    print('Yes' if P > M else 'No')
    M = P

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]


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

Submission status: Time Limit Exceeded

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

f = 0
d = 1
e = 1
for i in range(n-k):
    for j in range(k):
        d *= a[i+j]
        e *= a[i+j+1]

    if d < e:
        print("Yes")
        d,e = 1,1
    else:
        print("No")
        d,e = 1,1

Submission status: Time Limit Exceeded

Solution code:
# -*- coding: utf-8 -*-
import numpy as np
import sys
from collections import deque
from collections import defaultdict
import heapq
import collections
import itertools
import bisect
from scipy.special import comb
import copy
sys.setrecursionlimit(10**6)


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


def z():
    return int(sys.stdin.readline())


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


def C(line):
    return [sys.stdin.readline() for _ in range(line)]


N, K = zz()
A = zz()
hyouka = [1] * (N)
mul_A = [1]*(N+1)
mul_A[0] = 1
# mul_A[1] = A[0]
for i in range(N):
    mul_A[i] *= mul_A[i-1]*A[i]

for i in range(K - 1, N):
    # print(mul_A[i], mul_A[i-K])
    hyouka[i] = mul_A[i]//mul_A[i-K]


# print(hyouka[K-1:])
prev = hyouka[K-1]
for now in hyouka[K:]:
    if (prev < now):
        print('Yes')
    else:
        print('No')
    prev = now

Submission status: Time Limit Exceeded

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

S=[1]

for n in range (N):
    if n<K:
        S.append(A[n]*S[-1])
    else:
        S.append(A[n]*S[-1]/A[n-K])

for i in range (K+1,N+1):
    if S[i]>S[i-1]:
        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()]
ans=[a[0]]

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

Submission status: Time Limit Exceeded

Solution code:
#!/usr/bin/env python
# coding: utf-8

# In[11]:


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


# In[12]:


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


# In[ ]:

Submission status: Time Limit Exceeded

Solution code:
n, k = map(int, input().split())
a = list(map(int, input().split()))
ls = []
for j in range(n-k+1):
    x = 1
    for i in range(j,k+j):
        x *= a[i]
    ls.append(x)
for i in range(1,len(ls)):
    if ls[i] > ls[i-1]:
        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()))

prev = 0
point = 1
ans = []
for i in range(N):
    if i < K:
        point *= A[i]
    else:
        prev = point
        point *= A[i]
        point /= A[i-K]
        if prev < point:
            ans.append("Yes")
        else:
            ans.append("No")
print(*ans, sep='\n')

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
def main():
    n,k=map(int,input().split())
    a=list(map(int,input().split()))
    prev=1
    cnt=0
    for i in range(k):
        prev*=a[i]
    for i in range(k,n):
        if i==0: continue
        crnt=prev/a[cnt]*a[i]
        if crnt > prev: print('Yes')
        else: print('No')
        prev=crnt
        cnt+=1
    return

if __name__=='__main__':
    main()

Submission status: Time Limit Exceeded

Solution code:
import sys
from math import ceil, floor, sqrt, sin, cos, pi
from itertools import accumulate, permutations, combinations
from fractions import gcd # 最大公約数
from collections import deque, Counter
from operator import itemgetter
from heapq import heappop,heappush
sys.setrecursionlimit(10**7)
def lcm(x, y): return ((x * y) // gcd(x, y)) # 最小公倍数
# list(map(int, input().split()))
n, k = map(int, input().split())
a = list(map(int, input().split()))
rui = [1]
t = 1
for i in range(n):
    t *= a[i]
    if i < k:
        rui += [t]
    else:
        rui += [t // rui[i - k + 1]]
        if rui[i + 1] > rui[i]:
            print('Yes')
        else:
            print('No')
#print(rui)

Submission status: Time Limit Exceeded

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

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

def prod(i, k, pre):
    now = pre / A[i-k-1] * A[i-1]
    return now

for i in range(k+1, n+1):
    now = prod(i, k, pre)
    if now <= pre:
        print('No')
    else:
        print('Yes')
    pre = now

Submission status: Time Limit Exceeded

Solution code:
str1=input().split()
str2=input().split()
n=int(str1[0])
k=int(str1[1])
A=len(str2)*[0]
i=0
for s in str2:
    A[i]=int(str2[i])
    i+=1

i=k
tmp=1
while i>0:
    i-=1
    tmp*=A[i]
i=k+1
while i<=n:
    tmp1=tmp*A[i-1]//A[i-k-1]
    if tmp1>tmp:
        print("Yes")
    else:
        print("No")
    tmp=tmp1
    i+=1

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
import sys
def IL(): return map(int,sys.stdin.readline().rstrip().split())

if __name__=='__main__':
    n,k = IL()
    a = list(IL())
    l = n-k+1
    b = []
    ans = []
    for i in range(l):
        tmp = a[i:i+k]
        result = 1
        for rep in tmp:
            result = result*rep
        b.append(result)
        if 0<i:
            if b[i-1]<result:
                ans.append('Yes')
            else:
                ans.append('No')
    
    for rep in ans:
        print(rep)
    exit()

Submission status: Time Limit Exceeded

Solution code:
# -*- coding: utf-8 -*-

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

for i in range(k + 1, n + 1):
    _s_k = 1
    s_k = 1
    for j in range(k):
        _s_k *= scores[i - j - 2]
        s_k *= scores[i - j - 1]

    if _s_k < s_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()))

sum=[0]*n
sum[0]=a[0]
for i in range(1,n):
    sum[i]=sum[i-1]*a[i]
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')

Submission status: Time Limit Exceeded

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

point = []

for i in range(n-k+1):
    point_new = 1
    #for j in range(i,k+i):
        #point_new *= li[j]
    point.append(sum(li[i:k+i]))
    
for i in range(1,len(point)):
    if point[i] > point[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()))
sum = 0
last = 0
sw = 0
for num in range(K):
  last += A[num]
for i in range(1,N-K+1):
  for j in range(K):
    sum += A[i+j]
    if last < sum:
      print("Yes")
      sw = 1
  if sw ==0:
    print("No")
  last = sum
  sum = 0
  sw = 0

Submission status: Time Limit Exceeded

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

num = n-k

ans = 1
before = 0

for i in range(num+1):
    ans *= a[i]

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

Submission status: Time Limit Exceeded

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

for i in range(N-K+1):
    score = 1
    for j in range(i, K+i):
        score *= A[j]
    scores.append(score)

for i in range(len(scores)-1):
    if scores[i] < scores[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()))
#N,K=5 ,3
#A=[96, 98, 95, 100, 20]
ten=[0]*(N-K+1)
a=1
for i in range(K):
    a*=A[i]
#print(a)   
ten[0]=a
for i in range(1,(N-K+1)):
    ten[i]=ten[i-1]*(A[K+i-1]/A[i-1])
#print(ten)
for i in range(1,N-K+1):
    #print(ten[i])
    if ten[i]>ten[i-1]:
        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())))
scorerange = N-K
for semester in range(scorerange):
    recent = A[semester:semester+K+1]
    if (recent[0]<recent[-1]):
        print("Yes")
    else:
        print("No")

Submission status: Time Limit Exceeded

Solution code:
N,K = [int(x) for x in input().split()]
A = [int(x) for x in input().split()]
before = 1
for i in A[:K]:
    before *= i

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

    if(val > before):
        print("Yes")
    else:
        print("No")
    before = val

Submission status: Time Limit Exceeded

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

cumpro=[]

pro=1
for i in range(n):
    if i<k:
        pro*=a[i]
        cumpro.append(pro)
    else:
        pro/=a[i-k]
        pro*=a[i]
        cumpro.append(pro)

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

Submission status: Time Limit Exceeded

Solution code:
from functools import reduce

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

before = 1

for a in ai[ 0 : k ]:
    before *= a

for i in range(n - k):
    after = before * ai[i + k] // ai[i]

    if before < after:
        print('Yes')

    else:
        print('No')

    before = after

Submission status: Time Limit Exceeded

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

prev = 1
for k in range(K):
    prev = (prev * A[K-1-k])
# print(prev)

for i in range(K, N):
    # print('div', i, K, i-K)
    prod = A[i]*(prev//A[i-K])
    if prev != -1:
        if prev < prod:
            print('Yes')
        else:
            print('No')
    prev = prod

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]

idx = 0
for i in range(K, N):
    if prev < prev // A[idx] * A[i]:
        ans = "Yes"
    else:
        ans = "No"
    print(ans)

    prev = prev // A[idx] * A[i]
    idx += 1

Submission status: Time Limit Exceeded

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

score: list = []
for i in range(k - 1, n):
    tmp_score = 1
    for j in range(k):
        tmp_score *= a[i - j]
    score.append(tmp_score)

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

Submission status: Time Limit Exceeded

Solution code:


N,K = input().split()
AList = list(map(int, input().split()))
CSList = []

i=int(K)
j=0
while j<=int(N)-int(K):
    BList=AList[j:i]
    if j==0:
        MAE=BList[0]
    elif MAE>=BList[-1]:
        print("No")
        MAE=BList[0]
    elif MAE<BList[-1]:
        print("Yes")
        MAE=BList[0]
    i+=1
    j+=1

Submission status: Time Limit Exceeded

Solution code:
from operator import mul
from functools import reduce

n, k = list(map(int, input().split()))
a = list(map(int, input().split()))
flag = [False] * (n - k)
r = [0] * (n - k + 1)
for i in range(n - k + 1):
    r[i] = reduce(mul, a[i : i + k])

    if i > 0:
        if r[i] > r[i - 1]:
            flag[i - 1] = True
for i in flag:
    print("Yes") if i else print("No")

Submission status: Time Limit Exceeded

Solution code:
nk = input('')
n = int(nk.split()[0])
k = int(nk.split()[1])

alist = list(map(int,input('').split()))

pre=0
for i in range(n-k+1):
    result=1
    record=""
    for j in range(k):
        result *= alist[j+i]
#        record += " " + str(alist[j+i])
#    print("[{}/{}]:{} = {}".format(i,i+k-1,result,record))
    if i>0:
        if result > pre:
            print('Yes')
        else:
            print('No')
    pre=result

Submission status: Time Limit Exceeded

Solution code:
#!/usr/bin/env python3
# N,M = map(int,sys.stdin.readline().split())
# a = tuple(map(int,sys.stdin.readline().split())) # single line with multi param
# a = tuple(int(sys.stdin.readline()) for _ in range(N)) # multi line with single param
# a = tuple(tuple(map(int,sys.stdin.readline().rstrip().split())) for _ in range(N)) # multi line with multi param
# s = sys.stdin.readline().rstrip()
# N = int(sys.stdin.readline())
# INF = float("inf")
import sys
from functools import reduce
N,K = map(int,sys.stdin.readline().split())

A = tuple(map(int,sys.stdin.readline().split())) # single line with multi param
pre = reduce((lambda x, y: x * y), [A[i] for i in range(K)])

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

Submission status: Time Limit Exceeded

Solution code:
n,k=map(int,input().split())
A=list(map(int,input().split()))
cc=1
for j in range(k):
  cc*=A[j]

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

Submission status: Time Limit Exceeded

Solution code:
def main():
    N, K = list(map(int, input().split(' ')))
    Ai = list(map(int, input().split(' ')))
    # print(Ai)
    P = []
    prev = 0
    now = 0
    # for i, n in enumerate(range(K-1, N)):
        
        
        # if i > 0:
        #     # print('a', n)
        #     prev = now
        #     now = sum(Ai[n-K+1:n+1])
        #     # print(now, prev)
        #     if now > prev:
        #         print('Yes')
        #     else:
        #         print('No')
        # else:
        #     # print('b', n)
        #     now = sum(Ai[n-K+1:n+1])
            
            
    # # print(P)
    # for i in range(len(P)-1):
    #     if P[i+1] > P[i]:
    #         print('Yes')
    #     else:
    #         print("No")
    
    S = [1]
    for i in range(len(Ai)):
        S.append(S[i] * Ai[i])
    # print(S, len(S))
    
    for n in range(K,N):
        # print(n, S[n], n-K, S[n-K])
        a1 = S[n] // S[n-K]
        a2 = S[n+1] // S[n-K+1]
        
        if a2 > a1:
            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()))
P = [1]
for i in range(len(A)):
    if i == 0:
        P.append(A[i])
        a = A[i]
    else:
        P.append(a*A[i])
        a *= A[i]
for i in range(K,N):
    if P[i]//P[i-K] < P[i+1]//P[i+1-K]:
        print('Yes')
    else:
        print('No')

Submission status: Time Limit Exceeded

Solution code:
# vim: fileencoding=utf-8


def main():
    n, k = map(int, input().split())
    aList = list(map(int, input().split()))
    hyoukaList = aList[:k]
    beforeHyouka = 1
    for i in hyoukaList:
        beforeHyouka *= i

    for i in aList[k:]:
        t = hyoukaList[1:]
        t.append(i)
        hyoukaList = t

        hyouka = 1
        for i in hyoukaList:
            hyouka *= i

        if beforeHyouka < hyouka:
            print("Yes")
        else:
            print("No")
        beforeHyouka = hyouka


if __name__ == "__main__":
    main()

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
N, K = map(int, input().split())
score = list(map(int, input().split()))
add = []
sc = 1
for i in score:
    sc *= i
    add.append(sc)
pre = 0
for i in range(K - 1, N):
    if i == K - 1:
        cur = add[i]
    else:
        cur = add[i] // add[i - K]
        print("Yes" if cur > pre else "No")
    pre = cur

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
n, k = [int(w) for w in input().split()]
la = [int(w) for w in input().split()]

mul = 1
for i in range(k):
    mul *= la[i]

bef = mul

for i in range(k, n):
    mul /= la[i-k]
    mul *= la[i]

    cond = mul > bef
    print("Yes" if cond else "No")

    bef = mul

Submission status: Time Limit Exceeded

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

d=list(map(lambda i:reduce(lambda x,y:x*y,a[i:i+k]),range(n-k+1)))
dd=list(map(lambda x,y:'Yes' if y>x else 'No',d[:-1],d[1:]))
for i in range(len(dd)):print(dd[i])

Submission status: Time Limit Exceeded

Solution code:
from functools import  reduce
n,k=map(int,input().split())
l=list(map(int,input().split()))
x=reduce(lambda x,y: x*y,l[:k])
temp=[x]
for i in range(k,len(l)):
	if l[i]<=l[i-k]:
		print('No')
	else:
		print('Yes')

Submission status: Time Limit Exceeded

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

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


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

Submission status: Time Limit Exceeded

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

dp = [1] * (n-k+1)

for i in range(0,k):
    dp[0] = dp[0] * a_list[i]

for j in range(1, n-k+1):
    dp[j] = dp[j-1] * a_list[k+j-1] / a_list[j-1]

for l in range(len(dp)-1):
    if dp[l] < dp[l+1]:
        print('Yes')
    else:
        print('No')

Submission status: Time Limit Exceeded

Solution code:
n , k = [int(x) for x in input().split()]
# arr = []
# for i in range(0, n):
# 	ele = int(input())
# 	arr.append(ele)
arr = []
arr = list(map(int, input().split())) 
p = 1
for i in range(0,k):
	p *= arr[i]
tmp = p
for i in range(k,n):
	p = (tmp/arr[i-k])*arr[i]
	if(p>tmp):
		print("Yes")
	else:
		print("No")
	tmp = p

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):
    x = 1
    y = 1
    for j in range(i,i+k):
        x *= a[j]
        y *= a[j+1]
    ans = "No"
    if y>x:
        ans = "Yes"
    print(ans)

Submission status: Time Limit Exceeded

Solution code:
import sys
input = sys.stdin.readline
import numpy as np

n, k = map(int, input().split())
AA =[]
c =False
for a in input().strip().split():
    a = int(a)
    if not c:
        AA.append(a)
        if len(AA) == k:
            c = True
    else:
        base = AA[0]
        next = a
        if next - base > 0:
            print("Yes")
        else:
            print("No")
        AA = AA[1:]
        AA.append(a)