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 operator
import functools
prod = functools.partial(functools.reduce, operator.mul)
n, k = map(int, input().split())
a = list(map(int, input().split()))

l = n - k + 1
lis = [0]*l
#0, 1, 2
for i in range(l):
  lis[i] = prod(a[i:i+k])

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

Submission status: Time Limit Exceeded

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

now = 1
pre = 0
for i in range(0,n[1]):
    now *= a[i]

for i in range(n[1],n[0]):
    pre = now
    now /= a[i-n[1]]
    now *= a[i]

    if now > pre:
        print("Yes")
    else:
        print("No")

Submission status: Time Limit Exceeded

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

fact = [1] + [0] * N
for i,ai in enumerate(A, 1):
  fact[i] = fact[i-1] * ai

for i in range(K, N):
  score_1 = fact[i] // fact[i-K]
  score_2 = fact[i+1] // fact[i-K+1]
  print('Yes' if score_1 < score_2 else 'No')

Submission status: Time Limit Exceeded

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

rl = []

for i in range(k-1,n):
  j = 0
  r = 1
  for j in range(k):
    r = r * a[i-j]
    j += 1
  rl.append(r)
  i += 1

for m in range(n-k):
  if rl[m+1] > rl[m]:
    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=N-K+1
sum=list(range(n))

for i in range(n):
    sum[i]=A[K+i-1]
    for j in range(K-1):
        sum[i]*=A[(K+i-2-j)]
    
for i in range(len(sum)-1):
    if sum[i]>=sum[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()))

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

    scores.append(score)
    scores_append = scores.append

    for j in range(k, n):
        score_before = scores[-1]
        score = score_before * a[j] / a[j-k]
        scores_append(score)
        if score > score_before:
            print('Yes')
        else:
            print('No')

            
if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

Solution code:
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007

def calcSum(n, A):
    return n

def main():
    N, K = map(int, readline().split())
    A = list(map(int, readline().split()))

    l = [0] * (N + 1)
    for i in range(K, N + 1):
        pi = 1
        if (K == i):
            for j in range(i - K + 1, i + 1):
                pi *= A[j - 1]
        else:
            # print("A[i - K]=")
            # print(A[i - K])
            # print("A[i - 1]=")
            # print(A[i - 1])
            pi = l[i - 1] * A[i - 1] / A[i - K - 1] 
            # pi = l[i - 1] / A[j - K]
        l[i] = pi

        if (i != K):
            # print(l[i - 1])
            # print(l[i])
            if (l[i - 1] < l[i]):
                print("Yes")
            else:
                print("No")
    return


if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

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

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

pre_Ai = pre_Ai_1 / A[0] * A[K]

for n in range(1,N-K):
    if pre_Ai_1 < pre_Ai:
        print('Yes')
    else:
        print('No')
    pre_Ai_1 = pre_Ai
    pre_Ai = pre_Ai / A[n] * A[n+K]

if pre_Ai_1 < pre_Ai:
    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 = 1
score_before = 1
for i in range(N):
    if (i >= K):
        for j in range(K):
            score *= A[i - j]
        score_before = score // A[i] * A[i - K]
        if(score > score_before):
            print("Yes")
        else:
            print("No")

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
N,K = [int(i) for i in input().split()]
A = [int(i) for i in input().split()]
ans = [0]*(N-K+1)
score = 1
for i in range(K):
    score *= A[i]
for i in range(K, N):
    ans[i - K] = score
    score //= A[i - K]
    score *= A[i]
ans[-1] = score
print("\n".join(["Yes" if ans[i] > ans[i-1] else "No" for i in range(1,len(ans))]))

Submission status: Time Limit Exceeded

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

dp = [0] * (N+1)

for i in range(K,N+1):

    if i == K:
        temp = 1
        for j in range(K):
            temp *= A[i-1-j]
        dp[i] = temp
        continue

    dp[i] = int(dp[i-1] // A[i-1-K] * A[i-1])
    if i > K:
        if dp[i-1] < dp[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()))
A = []
for i in range(n-k+1):
    A.append(1)
    for j in range(i, k+i):
        A[i] = A[i]*a[j]
        if A[i] > A[i-1]:
            break
for k in range(n-k):
    if A[k+1] > A[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()))
n=N-K+1
sum=[0]*n

for i in range(n):
    sum[i]=A[K+i-1]
    for j in range(K-1):
        sum[i]*=A[(K+i-2-j)]
    
for i in range(len(sum)-1):
    if sum[i]>=sum[i+1]:
        print("No")
    else:
        print("Yes")

Submission status: Time Limit Exceeded

Solution code:
import functools
import operator

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

i = k + 1
old = a[i-k-1:i-1]
o_score = functools.reduce(operator.mul, old)
n_score = o_score / a[i-k-1] * a[i-1]
while i <= n:
  if o_score < n_score:
    print("Yes")
  else:
    print("No")
  o_score = n_score
  n_score = n_score / a[i-k] * a[i]
  i += 1

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

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

#print(cum)
# #https://qiita.com/keymoon/items/11fac5627672a6d6a9f6
# import sys
# T = sys.stdin.readline().rstrip()
# NT = len(T)
# P = sys.stdin.readline().rstrip()
# NP = len(P)
# if NT < NP:
#     exit()
# MOD = 2**61-1 #prime
# A = [ord(c) for c in T]
# pows = [1]*(NT+1)
# shash = [0]*(NT+1)
# for i in range(NT):
#     pows[i+1] = (pows[i]*126)%MOD
#     shash[i+1] = (shash[i]*126+A[i])%MOD
# ph = 0
# for i in range(NP):
#     ph = (ph*126+ord(P[i]))%MOD
# for i in range(len(T)-NP+1):
#     if ph == (shash[i+NP]-shash[i]*pows[NP])%MOD:
#         print(i)

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,M = map(int,input().split())
a = list(map(int,input().split()))
from collections import deque
a_num = 1
for i in range(0,M):
  a_num = a_num*a[i]  
d = deque()
d.append(a_num)
for i in range(M,N):
  b_num = (a_num/a[i-M])*a[i]
  if i>M-1:
    if a_num<b_num:
      print("Yes")
    else:
      print("No")
  a_num =b_num

Submission status: Time Limit Exceeded

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

def arith_score(nums,x=1):
      for i in range(len(nums)):
            x *= nums[i]
      return x

for i in range(k,n+1):
      score_data.append(arith_score(data[i-k:i]))

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

Submission status: Time Limit Exceeded

Solution code:
import sys
input = sys.stdin.readline
print = sys.stdout.write
N, K = map(int, input().split())
A = tuple(map(int, input().split()))
temp = 1
for i in range(K):
  temp *= A[i]
for i in range(1, N - K + 1):
  scr = 1
  for j in range(K):
    scr *= A[i+j]
  print('Yes\n' if scr > temp else 'No\n')
  temp = scr

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])
  if list_a[0] < list_b[-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())))
result = []

for i in range(k,n+1):
    result.append(reduce(mul, a[i-k:i]))

for i in range(len(result)-1):
    if result[i] < result[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()))

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

for i in range(n - k + 1): #iはスタート地点
  for j in range(i, i + k): #Aのj番目の要素をかける
    score[i] = score[i] * A[j]
  
for i in range(len(score) - 1):
  if score[i] < score[i + 1]:
    print("Yes")
  else:
    print("No")

Submission status: Time Limit Exceeded

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

for i in range(K+1, N+1):
  s = x[i-1]
  for j in range(1, K):
    s *= x[i-1-j]
  u = s/(x[i-1])*(x[i-K-1])
  u=int(u)

  if u<s:
    print("Yes")
  else:
    print("No")

Submission status: Time Limit Exceeded

Solution code:
# coding: utf-8
# Your code here!
# 幅優先探索（行きがけ）

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


def main():
    N, K = LI()
    Aarray = LI()

    start = 1
    for i in range(K):
        start *= Aarray[i]

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


if __name__ == '__main__':
    main()

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(n):
    if i < k:
        score *= a[i]
    else:
        pre = score
        score = score//a[i-k]*a[i]
        if score > pre:
            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()))

score = 0
for i in range(len(A)-K+1):
    t = functools.reduce(operator.mul, (A[i:K+i]))
    if i > 0:
        if score >= t:
            print("No")
        else:
            print("Yes")
    score = t

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

Solution code:
import sys
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:
import sys
input = sys.stdin.readline
print = sys.stdout.write
N, K = map(int, input().split())
A = tuple(map(int, input().split()))
ans = []
temp = 1
for i in range(K):
  temp *= A[i]
for i in range(1, N - K + 1):
  scr = 1
  for j in range(K):
    scr *= A[i+j]
  ans.append('Yes' if scr > temp else 'No')
  temp = scr
print('\n'.join(ans))

Submission status: Time Limit Exceeded

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

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

    scores.append(score)
    scores_append = scores.append

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

            
if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

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

  presum = 0
  sum = 1

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

  for i in range(n-k+1):
    if presum == 0:
      pass
    elif sum==presum:
      print("No")
    elif sum<presum:
      print("No")
    elif presum<sum:
      print("Yes")
    if i != (n-k):
      presum = sum
      sum=int((sum/a[i])*a[i+k])


if __name__ == "__main__":
  main()

Submission status: Time Limit Exceeded

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

def main() :

    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

if __name__ == '__main__':
    main()

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
num = 0
firstTry = True
for j in range(k):
  temp *= a[j]
for i in range(maxArr + 1):
  if(firstTry):
    firstTry = False
  else:
    temp /= a[num]
    temp *= a[num + k]
    num += 1
  ans[i] = temp

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

Submission status: Time Limit Exceeded

Solution code:
n,k=input().split()
n=int(n)
k=int(k)
a = list(map(int,input().strip().split()))[:n]
def multiplyList(myList) : 
    result = 1
    for x in myList: 
         result = result * x  
    return result
li=[]
for i in range(0,len(a)-k+1):
    
    li.append(multiplyList(a[i:i+k]))

for j in range(len(li)-1):
    if li[j]<li[j+1]:
        print("Yes")
    else:
        print("No")

Submission status: Time Limit Exceeded

Solution code:
def prod(lst):
  result = 1
  for i in lst:
    result = result * int(i)
  return result

N, K = map(int, input().split())
A = input().split()
score = [prod(A[i:i+K]) for i in range(N-K+1)]

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

Submission status: Time Limit Exceeded

Solution code:
from math import prod
n,k = map(int,input().split())
arr = list(map(int,input().split()))
j = 0
c = prod(arr[j:k])
for i in range(k,n):
    d = (c * arr[i])//arr[j]
    if d > c:
        print("Yes")
    else:
        print("No")
    c = d
    j += 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):
    thescore=a[i]
    lastsemester=a[i-1]
    for j in range(1,k):
        thescore*=a[i-j]
        lastsemester*=a[i-1-j]
    if thescore>lastsemester:
        print("Yes")
    else:
        print("No")

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

for i in range(K, N+1):
    tmp[i] = sum(A_list[i-K:i])

for i in range(K+1, K+1+N-K):
    if tmp[i] > tmp[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()))

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

Submission status: Time Limit Exceeded

Solution code:

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

Submission status: Time Limit Exceeded

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

s = a[:k]

for i in range(n-k):
  b = s[0]
  if a[k+i] > b:
    print ('Yes')
  else:
    print ('No')
  s.append(a[k+i])
  s.pop(0)

Submission status: Time Limit Exceeded

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

hyouten=[0]*N

for i in range(K-1,N):
        li2=li[int(i-K+1):int(i+1)]
        #print(li2)

        ans=1
        for j in li2:
            ans=ans*j
        hyouten[int(i)]=ans
#print(hyouten)

for i in range(K,N):
    if hyouten[int(i)] > hyouten[int(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()))

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


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

#    print(end,start)

    if end>start:
        print('Yes')
    else:
        print('No')
    start=end

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):
    if prod(A[i:K+i]) < prod(A[i+1:K+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()))

seki_list = []
seki = 1
temp = 0

seki_list_append = seki_list.append

for i in A:
    seki *= i
    seki_list_append(seki)

point = seki_list[k-1]

for i in range(k, n):
    temp = seki_list[i]/seki_list[i-k]
    if temp > point:
        print("Yes")
        point = temp
    else:
        print("No")
        point = temp

Submission status: Time Limit Exceeded

Solution code:
n,k = map(int, input().split())
a = list(map(int, input().split()))
limit, mul, m = n-k+1, [], 1

for i in range(limit):
    if i == 0:
        for j in a[i: k+i]:
            m *= j
    else:
        m = (m//a[i-1])*a[k+i-1]
    mul.append(m)

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

Submission status: Time Limit Exceeded

Solution code:
N,M = map(int,input().split())
a = list(map(int,input().split()))
from collections import deque
a_num = 1
for i in range(0,M):
  a_num = a_num*a[i]  
d = deque()
d.append(a_num)
for i in range(M,N):
  a_num =(a_num/a[i-M])*a[i]
  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:
N,K=map(int,input().split())
A=list(map(int,input().split()))
sum=[0]*(N-K+1)
j=0
for i in range(N-K+1):
    sum[i]=A[K+i-1]
    for j in range(K-1):
        sum[i]*=A[(K+i-2-j)]
    
for i in range(len(sum)-1):
    if sum[i]>=sum[i+1]:
        print("No")
        j+=1
    else:
        print("Yes")

Submission status: Time Limit Exceeded

Solution code:
#3

n, k = map(lambda x: int(x), input().split())
list_a =  list(map(lambda x: int(x), input().split()))
list_score = []

for i in range(n):
    if i < k - 1:
        continue
#     print(i-k, i+1)
    list_score.append(sum(list_a[i-k+1:i+1]))
# print(list_score)

score_before = list_score[0]
for score in list_score[1:]:
    if score_before < score:
        print('Yes')
        score_before = score
        continue
    print('No')
    score_before = score

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:
def resolve():
    n, k = map(int, input().split())
    A = list(map(int, input().split()))
    for i in range(k,n):
        before = 1
        for j in A[i-k:i]:
            before *= j
        if before < before/A[i-k]*A[i]:
            print("Yes")
        else:
            print("No")
resolve()

Submission status: Time Limit Exceeded

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

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 = []
for i in range(n - k + 1):
  b.append(1)
  for j in range(k):
    b[i] *= a[i+j]
    if b[i] > b[i-1]:
      print("Yes")
      break
  if b[i] <= b[i-1] and i != 0:
    print("No")

Submission status: Time Limit Exceeded

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

for n in range(0,N-K):
    Ai_1 = A[n]
    Ai = A[n+1]
    for k in range(n+1,n+K):
        Ai_1 = Ai_1 * A[k]
        Ai = Ai * A[k+1]
    if Ai_1 < Ai:
        print('Yes')
    else:
        print('No')

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

presum = 0
sum = 1

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

for i in range(n-k+1):
  if presum == 0:
    pass
  elif sum==presum:
    print("No")
  elif sum<presum:
    print("No")
  elif presum<sum:
    print("Yes")
  if i != (n-k):
    presum = sum
    sum=int((sum/a[i])*a[i+k])

Submission status: Time Limit Exceeded

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

rl = []

for i in range(k-1,n):
  j = 0
  r = 1
  while j < k:
    r = r * a[i-j]
    j += 1
  rl.append(r)
  i += 1



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

Submission status: Time Limit Exceeded

Solution code:
import functools
import operator

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

i = k + 1
old = a[i-k-1:i-1]
new = a[i-k:i]
o_score = functools.reduce(operator.mul, old)
n_score = functools.reduce(operator.mul, new)
while i <= n:
  if o_score < n_score:
    print("Yes")
  else:
    print("No")
  o_score = o_score / a[i-k-1] * a[i-1]
  n_score = n_score / a[i-k] * a[i]
  i += 1

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
n,k=map(int,input().split())
a=list(map(int,input().split()))
l=[0]*(n+1)
l[0]=1
l[1]=a[0]
for i in range(2,n+1):
  l[i]=l[i-1]*a[i-1]
#print(l)
grade=[0]*(n-k+1)
for i in range(n-k+1):
  grade[i]=l[i+k]//l[i]
#print(grade)
for i in range(n-k):
  if grade[i]<grade[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 = []
g = 0
for i in range(N-K+1):
  k = 1
  for s in range(K):
    k *= a[s+i]%10**9
  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:
s = input().split()
N = int(s[0])
K = int(s[1])
A = input().split()

for i in range(K, N):
    m1 = 1
    m2 = 1
    for j in range(K):
        m1 *= int(A[i - j - 1])
        m2 *= int(A[i - j - 0])
    print('Yes' if m1 < m2 else 'No')

Submission status: Time Limit Exceeded

Solution code:
N,K=map(int,input().split())
A=list(map(int,input().split()))
def score(A,N,K):
    s=1
    for i in range(N-K+1,N+1):
        s*=A[i]
    return s

for i in range(K-1,N-1):
    a=score(A,i,K)
    b=score(A,i+1,K)
    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()))
A = []
Index = 0

def getRate(list, int1, int2):
    value = 1
    for i in range(int1, int2):
        value = value * list[i]
    return value

for i in range(N-K+1):
    A.append(getRate(a, i, K + i))

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

Submission status: Time Limit Exceeded

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

# from scipy.sparse.csgraph import csgraph_from_dense, floyd_warshall
# from decimal import Decimal
# from collections import defaultdict, deque

sys.setrecursionlimit(10000000)

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: (x * y) // math.gcd(x, y)

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


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N, K = il()
    A = il()

    tmp = 1
    for k in reversed(range(K)):
        tmp *= A[k]
    for k in range(K+1, N + 1):
        p = 1
        for i in range(k-K, k):
            p *= A[i]

        if tmp < p:
            print('Yes')
        else:
            print('No')

        tmp = p


if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

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

def main():
    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')

            
if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

Solution code:
parm = input().split(" ")
A = input().split(" ")
N = int(parm[0])
K = int(parm[1])
wk = 1
for idx in range(K):
  wk = wk * int(A[idx]) 

for idx in range(N - K):
  wk_1 = wk
  wk_2 = wk * int(A[idx + K]) / int(A[idx])
  if wk_2 > wk_1:
    print ("Yes")
  else:
    print("No")
  wk = wk_2