Problem:


Score: 300 points

Problem Statement

M-kun is a student in Aoki High School, where a year is divided into N terms.

There is an exam at the end of each term. According to the scores in those exams, a student is given a grade for each term, as follows:

For the first through (K-1)-th terms: not given.

For each of the K-th through N-th terms: the multiplication of the scores in the last K exams, including the exam in the graded term.

M-kun scored A_i in the exam at the end of the i-th term.

For each i such that K+1 \leq i \leq N, determine whether his grade for the i-th term is strictly greater than the grade for the (i-1)-th term.

Constraints

2 \leq N \leq 200000

1 \leq K \leq N-1

1 \leq A_i \leq 10^{9}

All values in input are integers.

Input

Input is given from Standard Input in the following format:

N K
A_1 A_2 A_3 \ldots A_N

Output

Print the answer in N-K lines.

The i-th line should contain Yes if the grade for the (K+i)-th term is greater than the grade for the (K+i-1)-th term, and No otherwise.

Sample Input 1

5 3
96 98 95 100 20

Sample Output 1

Yes
No

His grade for each term is computed as follows:

3-rd term: (96 \times 98 \times 95) = 893760

4-th term: (98 \times 95 \times 100) = 931000

5-th term: (95 \times 100 \times 20) = 190000

Sample Input 2

3 2
1001 869120 1001

Sample Output 2

No

Note that the output should be No if the grade for the 3-rd term is equal to the grade for the 2-nd term.

Sample Input 3

15 7
3 1 4 1 5 9 2 6 5 3 5 8 9 7 9

Sample Output 3

Yes
Yes
No
Yes
Yes
No
Yes
Yes



Sample input:
5 3
96 98 95 100 20


Sample output:
Yes
No

Submission status: Time Limit Exceeded

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

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

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

Submission status: Time Limit Exceeded

Solution code:
N,K = map(int,input().split(' '))
A = list(map(int,input().split(' ')))
sum_score = A[0]
for i in range(1,K):
    sum_score *= A[i]
cnt = 0
for k in range(K-1,N):
    prev_sum_score = int(sum_score)
    if k + 1 > N - 1:
        break
    sum_score /= A[cnt]
    sum_score *= A[k+1]
    cnt += 1
    if prev_sum_score >= int(sum_score):
        print("No")
    else:
        print("Yes")

Submission status: Time Limit Exceeded

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

ans = []

for i in range(n-k):
    if (a[i+k] == 0):
        ans.append("No")
        continue

    if (0 in a[i:i+k-1]):
        ans.append("Yes")
        continue

    if (a[i] < a[i+k]):
        ans.append("Yes")
    else:
        ans.append("No")

for i in range(len(ans)):
    print(ans[i])

Submission status: Time Limit Exceeded

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

hyoten = 1

for idx, a in enumerate(A):
    if idx < K:
        hyoten *= a
    else:
        next_hyoten = hyoten * a / A[idx - K]
        if next_hyoten <= hyoten:
            print('No')
        else:
            print('Yes')
        hyoten = next_hyoten

Submission status: Time Limit Exceeded

Solution code:
N, K = map(int, input().split())
A = [int(i) for i in input().split()]
i_list = [0] * (N+1)
cnt = 0

for k in range(K, N+1):
    A_sum = A[cnt]
    for i in range(cnt, K+cnt-1):
        if A[i+1] == 0:
            A_sum = 0
            break
        else:
            A_sum = A_sum * A[i+1]
    i_list[k] = A_sum
    A_sum = 0
    cnt = cnt + 1

for k in range(K, N):
    if i_list[k] < i_list[k+1]:
        print('Yes')
    else:
        print('No')

Submission status: Time Limit Exceeded

Solution code:
n,k = input().split()
a = list(map(int,input().split()))
ten1 =0
ten2 =0
for x in range(int(n)-int(k)):
    ten1 = 0
    ten2 = 0
    for y in range(int(k)):
        ten1 += a[y+x]
        ten2 += a[y+1+x]
    if ten1 < ten2:
       print("Yes")
    else:
        print("No")

Submission status: Time Limit Exceeded

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

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

for i in range(K, N):
    prev_score = score
    score = score * A[i] / A[i-K]
    if (prev_score < 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()))
mul = [1]
for i in range(n):
    mul.append(mul[i]*a[i])

total = mul[-1]
pre = mul[k]
for i in range(k+1, n+1):
    now = mul[i] // mul[i-k]
    if pre < now:
        print('Yes')
    else:
        print('No')
    pre = now

Submission status: Time Limit Exceeded

Solution code:
x=2
N,K=(int(x) for x in input().split())
A= list(map(int, input().split()))
a=["Yes"]
aa=N-K

for i in range(aa):
    a=1
    b=1
    for j in range(K):
        a*=A[i+j]
    for j in range(K):
        b*=A[i+j+1]
    if a<b :
        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()))

old_score = 1
new_score = 1

for i in range(n - k + 1): #iはスタート地点
    old_score = new_score
    new_score = 1
    
    list_ = A[i: i + k] #Aのj番目の要素をかける
    new_score = functools.reduce(operator.mul, list_)

    if i != 0 and old_score < new_score:
        print("Yes")
    elif i != 0 and old_score >= new_score:    
        print("No")

Submission status: Time Limit Exceeded

Solution code:
# import time

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

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

score2 = 0
for i in range(k,n):
    score2 = score // a[i-k] * a[i]
    if score2 > score:
        print("Yes")
    else:
        print("No")
    score = score2
# t2 = time.time()
# print(t2 - t1)

Submission status: Time Limit Exceeded

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

i = 0
b = []
b += [1]

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

for j in range(n-k):
  tmp = b[j] / a[j]
  b.append(tmp * a[k+j])
  
for j in range(n-k):
  if b[j] < b[j+1]:
    print("Yes")
  else:
    print("No")

print("")

Submission status: Time Limit Exceeded

Solution code:
from functools import reduce
from operator import mul

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

num = reduce(mul, a[:k])
for i in range(k, n):
    num2 = num*a[i]//a[i-k]
    if num < num2:
        print('Yes')
    else:
        print('No')
    num = num2

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 = 0
bkresult = 0

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

Submission status: Time Limit Exceeded

Solution code:
N, K= map(int, input().split(' '))
A = list(map(int, input().split(' ')))
a = [0] * 200010

def N_score(n):
    Score = 1
    if(a[n - 1] == 0):
        start = n - (K - 1)
        end = n + 1
        for i in range(start, end):
            Score *= A[i]
        a[n] = Score
        return Score
    else:
        a[n] = a[n-1]/A[n-K]*A[n]
        return a[n]


for i in range(K, N):
    score_i_1 = N_score(i-1)
    score_i = N_score(i)
    if(score_i_1 < score_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()))
 
seki_list = [0]*n
seki = 1
temp = 0

for i in range(n):
    seki *= A[i]
    seki_list[i] = 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:
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")
    elif (i > K):
        score_before = score
        score = score // A[i - K] * A[i]
        if(score > score_before):
            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(' ')))

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 j,p in enumerate(A[k-1:n+1]):
  i = j+k-1
  result = hyoka(i+1,p,b_point)
  if result > 0:
  	b_point = result

Submission status: Time Limit Exceeded

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


while K < N:
    if A[K]*A[K-1]*A[K-2]>A[K-1]*A[K-3]*A[K-3]:
        print("Yes")

Submission status: Time Limit Exceeded

Solution code:
import functools
import operator
import sys
 
def main():
    prod = functools.partial(functools.reduce, operator.mul)
    input = sys.stdin.readline
    
    n,k = map(int, input().split())
    a = list(map(int, input().split()))
    a_sum = [1]*n
    i = 0
 
    for _ in range(0,n-k+1):
        a_sum[i] = prod(a[i:k+i])
        if i != 0 and a_sum[i] > a_sum[i-1]:
                print("Yes")
        elif i != 0:
                print("No")
        i += 1
   
if __name__ == "__main__":
    main()

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+1):
  if i == k:
    sp = 1
    for j in range(k):
      sp *= a[i-j-1]
    before = sp
  else:
    sp = before * a[i-1] / a[i-k-1]
    if sp > before:
      print("Yes")
    else:
      print("No")
    before = sp

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

# print(a[4 - k: 4])
xs = []


def solve():
    tmp = 1
    for i in range(1, n - k + 1):
        ii = k + i
        if tmp == 1:
            for x in a[ii - k: ii]:
                tmp = x * tmp
            prevTmp = tmp * a[ii - k - 1] / a[ii - 1]
        else:
            prevTmp = tmp
            tmp = tmp / a[ii - k - 1] * a[ii - 1]

        if prevTmp < tmp:
            xs.append('Yes')
        else:
            xs.append('No')


solve()
print(*xs, sep='\n')

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):
  r = 1
  for j in range(k):
    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,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]  
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:
NK = list(map(int, input().split(' ')))
N = NK[0]
K = NK[1]
A = list(map(int, input().split(' ')))

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

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

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

Submission status: Time Limit Exceeded

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

for i in range(N-K):
  score_mean1 = sum(score_num[i:i+K])/K
  score_mean2 = sum(score_num[i+1:i+K+1])/K
  if score_mean2 <= score_mean1:
    print('No')
  else:
    print('Yes')

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

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

flg = True
for i in ans_list:
    if flg:
        befor = i
        flg = False
    else:
        if befor < i:
            print('Yes')
        else:
            print('No')
        befor = i

Submission status: Time Limit Exceeded

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

for i in range(k, n+1):
  for s in range(k):
    if s == 0:
      x = a[i-s-1]
    else:
      x = x * a[i-s-1]
  li.append(x)

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

Submission status: Time Limit Exceeded

Solution code:
def solve():
    n,k = map(int, input().split())
    a = list(map(int, input().split()))
    ans = [0]*(n-k+1)
    count = 0
    for i in range(n-k+1):
        ans[i] =a[i]
        for j in range(k-1):
            ans[i] = ans[i] * a[i+j+1]

        if count > 0:
            if ans[i-1]  < ans[i]:
                print('Yes')
            else:
                print('No')
        count = count + 1


solve()

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:    
        print('Yes' if m < (m//a[i-1])*a[k+i-1] else 'No')
        m = (m//a[i-1])*a[k+i-1]

Submission status: Time Limit Exceeded

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

gakki_sum = 1
gakki_sum_new = 1
for j in range(K):
        gakki_sum *= A[j]

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

Submission status: Time Limit Exceeded

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

A_sum = A[0]
for i in range(K-1):
    if A[i+1] == 0:
        A_sum = 0
        break
    else:
        A_sum = A_sum * A[i+1]
i_list[K-1] = A_sum
cnt = 0

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

Submission status: Time Limit Exceeded

Solution code:
N,M = map(int,input().split())
a = list(map(int,input().split()))
a_num = 1
for i in range(0,M):
  a_num = a_num*a[i]  
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 = 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(1, N - K + 1):
  score_2 = fact[K + i] // fact[i]
  score_1 = fact[K + i - 1] // fact[i - 1]
  print('Yes' if score_1 < score_2 else 'No')

Submission status: Time Limit Exceeded

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

def main():
  for i in range(k+1, n+1):
    sum_prev, sum_next = (1, 1)

    for j in range(i-k-1, i-1):
      sum_prev *= int(items[j])
      sum_next *= int(items[j+1])

    if (sum_prev < sum_next):
      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()))

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

for i in range(K,N+1):
  if i == K:
    Hyoten[i-K] = 1
    for j in range(i-K,i):
      Hyoten[i-K] *= A[j]
  else:
    s_val = A[i-K-1]
    Hyoten[i-K] = Hyoten[i-K-1] / s_val * A[i-1]
    
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()))

rl = []

for i in range(k-1,n):
  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()))
# print(A)
score = []
for i in range(N):

    
    if i >= K - 1:
        total = A[i]
        for j in range(1,K):
            total *= A[i-1*(j)]
        score.append(total)
        if i >= K:
            # print(score[-2])
            if score[-2] >= total:
                print('No')
            else:
                print('Yes')

Submission status: Time Limit Exceeded

Solution code:
def main():
    N, K = map(int, input().split())
    l = list(map(int, input().split()))
    
    for i in range(N - K):
        p = 0
        n = 0
        for j in range(K):
            p = p + l[j+i]
            n = n + l[j+i+1]
        if p < n:
            print('Yes')
        else:
            print('No') 
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()))
num = N - K
p_list = [0] * (num+1)

for i in range(num+1):
    p_list[i] = reduce(mul, A[i:i+K])
    if i > 0:
        if p_list[i] > p_list[i-1]:
            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()))

gakki_sum = 1
gakki_sum_new = 1
for j in range(K):
        gakki_sum *= A[j]

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

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//2):
    s *= x[i-1-j]*x[i-1-(j+1)]
  if K%2==0:
    s=s
  else:
    s=s*(x[i-K])

  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:
cons = [int(i) for i in input().split()]
numbers = [int(i) for i in input().split()]

for i in range(cons[0]-cons[1]):
  first =1
  second =1
  if i == 0:
    for con in range(i,cons[1]+i):
      first *=numbers[con]
      second *= numbers[con+1]
  else:
    first = second
    second = second/numbers[i]*numbers[i+cons[1]]
  if first < second:
    print('Yes')
  else:
    print('No')

Submission status: Time Limit Exceeded

Solution code:
N, K = map(int, input().split())
A = list(map(int, input().split()))
temp = 1
semester = [0 for _ in range(N)]

for i in range(N - K + 1):
    for _ in range(i, i + K):
        temp *= A[_]
    semester[i] = temp
    temp = 1

for i in range(N - K):
    if semester[i] < semester[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(k):
    temp *= data[i]

for i in range(k, n):
    old = temp
    temp = temp / data[i-k] * data[i]
    if temp > old:
        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()))
    before = 1
    for j in A[0:k]:
        before *= j
    for i in range(k,n):
        if before < before/A[i-k]*A[i]:
            print("Yes")
        else:
            print("No")
        before = before/A[i-k]*A[i]
resolve()

Submission status: Time Limit Exceeded

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

n = 1
c = 0

for i in range(N):
    if i <= K-1:
        n *= A[i]

    else:
        tmp = n
        tmp /= A[c]
        tmp *= A[i]

        if tmp > n:
            print("Yes")
        else:
            print("No")

        c += 1
        n = tmp

Submission status: Time Limit Exceeded

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

A_sum = A[0]
for i in range(K-1):
    if A[i+1] == 0:
        A_sum = 0
        break
    else:
        A_sum = A_sum * A[i+1]
i_list[K-1] = A_sum
cnt = 0

for k in range(K, N):
    i_list[k] = i_list[k-1] // A[cnt] * A[k]
    cnt = cnt + 1

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

Submission status: Time Limit Exceeded

Solution code:
from sys import stdin
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 = (int(x) for x in input().split())
A = [int(x) for x in input().split()]
ans = []
for i in range(N- K + 1):
  sum = 1
  for j in range(K):
    sum *= A[i + j]
  ans.append(sum)
for i in range(len(ans)-1):
  if ans[i] < ans[i+1]:
    print('Yes')
  else:
    print('No')

Submission status: Time Limit Exceeded

Solution code:
N,K = map(int,input().split())
T = list(map(int,input().split()))
Number = []
for j in range(N-K+1):
    Num=1
    for i in range(K):
        Num *=T[i+j]
    Number.append(Num)

for p in range(N-K):
    if Number[p+1] - Number[p] >0:
        print('Yes')
    else:
        print('No')

Submission status: Time Limit Exceeded

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

old_score = 1
new_score = 1

for i in range(n - k + 1): #iはスタート地点
    old_score = new_score
    new_score = 1
    for j in range(i, i + k): #Aのj番目の要素をかける
        new_score = new_score * A[j]

    if i != 0 and old_score < new_score:
        print("Yes")
    elif i != 0 and old_score >= new_score:    
        print("No")

Submission status: Time Limit Exceeded

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

brr = []

total = 1
for i in range(0, k):
    total = total * ara[i]

a = 0
brr.append(total)

for i in range(k, n):
    total = total // ara[a]
    total = total * ara[i]
    a = a + 1
    brr.append(total)

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

Submission status: Time Limit Exceeded

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

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


def solve(N: int, K: int, A: "List[int]"):
    score = 1
    for i in range(K):
        score *= A[i]

    prev_score = score
    for i in range(N-K):
        if A[i]!=A[i+K]:
            if A[i]!=1:
                score //= A[i]
            if A[i+K]!=1:
                score *= A[i+K]
        if score>prev_score:
            print(YES)
        else:
            print(NO)
        prev_score = score
    return


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

if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

Solution code:
#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(k-1, n):
    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:
n, k = map(int, input().split())
A = list(map(int, input().split()))

seki_list = [0]*n
seki = 1
temp = 0

for i in range(n):
    seki *= A[i]
    seki_list[i] = 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()))

# n学期制 -> n回のテスト
# k学期以降の成績の総乗

# import functools
# import operator

res = []
# for i in range(k-1, n):
    # print(a[i-(k-1):i+1])
    # pai = functools.partial(functools.reduce, operator.mul)
    # res.append(pai(a[i-(k-1):i+1]))


# まず初期値をgetする
# 次にインデックスを上手く動かしながら一つ前で割って、ネクストをかけあわせていく

def get_first_val(l):
    ans = 1
    for a_i in a[0:k]:
        ans = ans*a_i
    return ans

# print(get_first_val(a))
v = get_first_val(a)
res = [v]

i = k
pre = 0
nxt = k
for j in range(n-k):
    v = (v//a[pre])*a[nxt]
    res.append(v)
    pre += 1
    nxt += 1


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

Submission status: Time Limit Exceeded

Solution code:
import functools
import operator
import sys
 
def main():
    prod = functools.partial(functools.reduce, operator.mul)
    input = sys.stdin.readline
    
    n,k = map(int, input().split())
    a = list(map(int, input().split()))
    a_sum = [1]*n
 
    for i in range(0,n-k+1):
        a_sum[i] = prod(a[i:k+i])
        if i != 0 and a_sum[i] > a_sum[i-1]:
                print("Yes")
        elif i != 0:
                print("No")
   
if __name__ == "__main__":
    main()

Submission status: Time Limit Exceeded

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

ten1 = 0
ten2 = 0
for y in range(int(k)) :
    ten1 += a[y]

for x in range(int(n)-int(k)):
    for y in range(int(k)):
        ten2 += a[y+1+x]
    if ten1 < ten2:
       print("Yes")
    else:
        print("No")
    ten1 = ten2
    ten2 = 0

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):
    if i > K:
        if sum(A_list[i-K:i]) > sum(A_list[i-K-1:i-1]):
            print('Yes')
        else:
            print('No')

Submission status: Time Limit Exceeded

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

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()]
    min_value = min(a_list)
    for item in a_list :
        item /= min_value

    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:
#!/usr/bin/env python

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

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

# p = [inip]

p = [-1 for _ in range(n-k+1)]
p[0] = inip

tmp = inip
#print('inip =', inip)

for i in range(k, n): 
    s = tmp//a[i-k]*a[i]
    # p.append(s)
    p[i-k+1] = s 
    tmp = s 

# print('p =', p)

for i in range(len(p)-1):
    if p[i+1] > p[i]:
        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])
        if p[i] > p[i - 1]:
            print("Yes")
        else:
            print("No")

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

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)

Submission status: Time Limit Exceeded

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

A_sum = A[0]
for i in range(K-1):
    A_sum = A_sum * A[i+1]
i_list[K-1] = A_sum
cnt = 0

for k in range(K, N):
    i_list[k] = i_list[k-1] // A[cnt] * A[k]
    cnt = cnt + 1

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

t = 0
s = 1
u = 0
k_k = k
temp = []
while k != n+1:
  for i in range(t, k):
    alpha = a[i]
    s = s * alpha
  temp.append(s)
  k = k + 1
  s = 1
  t = t+1
  if u != 0:
    t_s = temp[u-1]
    t_t = temp[u]
    if t_s < t_t:
      print("Yes")
      u = u + 1
    else:
      print("No")
      u = u + 1
  else:    
    u = u + 1