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: Wrong Answer

Solution code:
#M-SOLUTIONS C
import numpy as np
n, k = map(int, input().split())
a = list(map(int, input().split()))
dv = []
for i in range(n-k+1):
  dv.append(np.prod(a[i:k+i]))
  if i > 0:
    if dv[i] > dv[i-1]:
      print('Yes')
    else:
      print('No')

Submission status: Wrong Answer

Solution code:
# import sys
import math #sqrt,gcd,pi
# import decimal
# import queue # queue
# import bisect
# import heapq # priolity-queue
# import time
# from itertools import product,permutations,\
    # combinations,combinations_with_replacement
# 重複あり順列、順列、組み合わせ、重複あり組み合わせ
# import collections # deque
# from operator import itemgetter,mul
# from fractions import Fraction
# from functools import reduce

mod = int(1e9+7)
# mod = 998244353
INF = 1<<50

def readInt():
    return list(map(int,input().split()))

def main():
    # n,k = readInt()
    # a = readInt()
    n = 200000
    k = 1
    a = [100000000 for i in range(n)]
    ans = []
    res = 1
    for i in range(n):
        x = res
        if i<k-1:
            res *= a[i]
        elif i==k-1:
            res *= a[i]
            if res>x:
                ans.append("Yes")
            else:
                ans.append("No")
        else:
            res //= a[i-k]
            res *= a[i]
            if res>x:
                ans.append("Yes")
            else:
                ans.append("No")
    print("\n".join(ans))
    return

if __name__=='__main__':
    main()

Submission status: Wrong Answer

Solution code:
import numpy as np
N,K = map(int,input().split())
A = np.array(list(map(int,input().split())))
A_low = np.prod(A[:K])
A_high = A_low

for i,j in enumerate(range(K,N)):
    A_high = A_high//A[i]*A[j]
    if(A_high>A_low):
        print('Yes')
    else:
        print('No')
    A_low= A_high

Submission status: Wrong Answer

Solution code:
import numpy as np
def resolve():
    N, K = list(map(int, input().split()))
    A = list(map(int, input().split()))
    ans = []
    for i in range(K-1, N):
        ls = []
        ls = np.prod(A[(i-(K-1)):i+1])
        ans.append(ls)

    for i in range(len(ans)-1):
        if ans[i] < ans[i+1]:
            print('Yes')
            continue
        print('No')
    return
resolve()

Submission status: Wrong Answer

Solution code:
import os
import heapq
import sys
import math
import operator
from collections import defaultdict
from io import BytesIO, IOBase


"""def gcd(a,b):
    if b==0:
        return a
    else:
        return gcd(b,a%b)"""

"""def pw(a,b):
    result=1
    while(b>0):
        if(b%2==1): result*=a
        a*=a
        b//=2
    return result"""



def inpt():
    return [int(k) for k in input().split()]


def main():
    n,k=map(int,input().split())
    ar=inpt()
    s=1
    for i in range(1,k):
        s*=ar[i]
    prev=s
    j=0
    for i in range(k,n):
        if(ar[j]<ar[i]):
            print('Yes')
        else:
            print('No')
        prev=s


BUFSIZE = 8192


class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)


class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")


sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n, k = map(int, input().split())
a = list(map(int, input().split()))
b = 1
mod = 10**9+7
for i in range(k):
    b *= a[i]
    b = b % mod


ans = [b]

for i in range(n-k):
    ans.append((ans[i]//a[i]*a[k+i]) % mod)

# print(ans)

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

Submission status: Wrong Answer

Solution code:
import numpy as np

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

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

score = np.product(A[:K])

i = 0

for k in range(K, N):
    score_1 = (score // A[i]) * A[k]
    # print(score, "\t:\t", score_1)
    i += 1
    
    if score < score_1:
        print("Yes")
    else:
        print("No")
        
    score = score_1

Submission status: Wrong Answer

Solution code:
# print('input >>')
N, K = map(int,(input().split()))
As = list(map(int,(input().split())))

prod = 1

for A in As[:K]:
    prod *= A

for i in range(K, N):
    next_prod = prod // As[i-K] * As[i]
    if next_prod > prod:
        print('Yes')
    else:
        print('No')
    next_prod = prod

# print('-----output-----')

Submission status: Wrong Answer

Solution code:
import numpy as np
n,k=map(int,input().split())
a=list(map(int, input().split()))
a=np.array(a)
hyou=np.zeros(n)
hyou[k-1]=np.prod(a[:k+1])
for i in range(k,n):
    hyou[i]=hyou[i-1]*a[i]//a[i-k]
    if hyou[i]>hyou[i-1]:
        print('Yes')
    else:
        print('No')

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
n, k = list(map(int, input().split()))
a = list(map(int, input().split()))
b = []
m = 1
for i in range(k):
  m*=a[i]
b.append(m)
m=0
for i in range(k, len(a)):
  b.append((b[m]//a[i-k])*a[i])
for i in range(1, len(b)):
  if b[i] > b[i-1]:
    print("Yes")
  else:
    print("No")

Submission status: Wrong Answer

Solution code:
import os
import heapq
import sys
import math
import operator
from collections import defaultdict
from io import BytesIO, IOBase


"""def gcd(a,b):
    if b==0:
        return a
    else:
        return gcd(b,a%b)"""

"""def pw(a,b):
    result=1
    while(b>0):
        if(b%2==1): result*=a
        a*=a
        b//=2
    return result"""



def inpt():
    return [int(k) for k in input().split()]


def main():
    n,k=map(int,input().split())
    ar=inpt()
    s=1
    for i in range(1,k):
        s*=ar[i]
    prev=s
    j=0
    for i in range(k,n):
        s*=ar[i]
        s//=ar[j]
        j+=1
        if(prev<s):
            print('Yes')
        else:
            print('No')
        prev=s


BUFSIZE = 8192


class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)


class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")


sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
import numpy as np
N,K = map(int,input().split())
A = np.array(list(map(int,input().split())))
A_low = np.prod(A[:K])
A_high = 0

for i,j in enumerate(range(K,N)):
    A_high = np.prod(A[i+1:j+1])
    if(A_high>A_low):
        print('Yes')
    else:
        print('No')
    A_low= A_high

Submission status: Wrong Answer

Solution code:
import numpy as np

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

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

score = np.product(A[:K])

i = 0

for k in range(K, N):
    score_1 = (score // A[i]) * A[k]
    
    i += 1
    
    if score < score_1:
        print("Yes")
    else:
        print("No")

Submission status: Wrong Answer

Solution code:
n,k = map(int , raw_input().split())
ais = map(int, raw_input().split())
for ii in range(k+1, n):
	print 'Yes' if ais[ii] > ais[ii - k] else 'No'

Submission status: Wrong Answer

Solution code:
import numpy as np

# = int(input())
# = str(input())
N, K = map(int, input().split())
A = list(map(int, input().split()))
# = [int(input()) for i in range(N)]
# = [list(map(int, input().split())) for i in range(N)]

first = np.asarray(A[:K])
score = np.prod(first)

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

Submission status: Wrong Answer

Solution code:
from copy import deepcopy
import numpy as np


nk = input().split()
n = int(nk[0])
k = int(nk[1])
ajs = input().split()
ajs = np.array([int(aj) for aj in ajs])

ak_current = ajs[:k].cumprod()[-1]

for i in range(k, n):
  ak_tmp = deepcopy(ak_current)
  ak_tmp = ak_tmp * ajs[i] / ajs[i-k]
  
  if ak_tmp > ak_current:
    print('Yes')
  else:
    print('No')
    
  ak_current = ak_tmp

Submission status: Wrong Answer

Solution code:
n,k = map(int,input().split())
a = list(map(int,input().split()))
tmp = 1
c = 0
ls = []
for i in range(k):
    tmp *= a[i]
ls.append(tmp)
for i in range(k-1):
    tmp /= a[i]
    tmp *= a[i+k]
    ls.append(tmp)

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

Submission status: Wrong Answer

Solution code:
N, K = map(int, input().split())
A = []
for i, a in enumerate(input().split()):
  if i < K:
    A.append(a)
    continue
  else:
    A.append(a)
    x = A.pop(0)
    if x < a:
      print('Yes')
    else:
      print('No')

Submission status: Wrong Answer

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

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

result = []
for i in range(K, N):
    t = p // A[i - K] * A[i]
    if t > p:
        result.append('Yes')
    else:
        result.append('No')
print(*result, sep='\n')

Submission status: Wrong Answer

Solution code:
import math
import sys
import numpy

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

pre = -1
for i in range(k, n + 1):
    now = numpy.prod((point[i-k:i]))
    if (pre == -1):
        pass
    elif (pre < now):
        print("Yes")
    else:
        print("No")
    pre = now

Submission status: Wrong Answer

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

now = 1
for i in range(len(a[k:])):
    new = now * a[i + k] / a[i]
    if new > now:
        print("Yes")
    else:
        print("No")

    now = new

Submission status: Wrong Answer

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

def solve(N, K, A):
    """
    N <= 200,000
    """
    P = 1
    for i in range(K-1):
        P *= A[i]

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

solve(N, K, A)

Submission status: Wrong Answer

Solution code:
n, k = map(int, input().split())
a = list(map(int, input().split()))
score = [0] * (n - k + 1)
x = 1
for i in range(n):
    x *= a[i]
    if i >= k - 1:
        print(x, a[i])
        score[i - k + 1] = x
        x //= a[i - k + 1]

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

Submission status: Wrong Answer

Solution code:
def prod(X):
    val = 1
    for x in X:
        val = val * x
    return val

N, K = map(int, input().split())
A = list(map(int, input().split()))
G = [prod(A[:K])]
for i in range(K, N):
    val = G[-1] // A[i - K] * A[i]
    G.append(val)
print(G)

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

Submission status: Wrong Answer

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

results = list()
for first, second in zip(A[0:N - K], A[K:N]):
    print(first, second)
    if second > first:
        results.append(True)
    else:
        results.append(False)

for res in results:
    if res:
        print('Yes')
    else:
        print('No')

Submission status: Wrong Answer

Solution code:
#dt = {} for i in x: dt[i] = dt.get(i,0)+1
import sys;input = sys.stdin.readline
inp,ip = lambda :int(input()),lambda :[int(w) for w in input().split()]

n,k = ip()
x = ip()
prev = 1
for i in range(k):
    prev *= x[i]
ans = []
for i in range(k,n):
    now = prev*x[i]//x[i-k-1]
    if now > prev:
        ans.append('Yes')
    else:
        ans.append("No")
    prev = now
for i in ans:
    print(i)

Submission status: Wrong Answer

Solution code:
from functools import reduce
from operator import mul

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

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

Submission status: Wrong Answer

Solution code:
N,K = map(int,input().split())
A = list(map(int,input().split()))
if K==1:
  for i in range(N):
    print('No')
else:
  left = 0
  right = K
  while True:
    if right>=N:
      break
    else:
      if A[right]>A[left]:
        print('Yes')
      else:
        print('No')

      left += 1
      right += 1

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys


def handler():
    n, m = [int(i) for i in input().strip().split()]
    a = [int(i) for i in input().strip().split()]
    for i in range(m, n):
        if a[i] <= a[i - m]:
            sys.stdout.write('NO\n')
        else:
            sys.stdout.write('YES\n')


def main():
    while True:
        try:
            handler()
        except ValueError:
            continue
        except EOFError:
            break


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
mod = 10**9 +7
N,K = map(int,input().split())
A = list(map(int,input().split()))
rep = 1
for i in range(K):
    rep *= A[i]
    rep %= mod

#この段階でrepはK学期の評価
tmp = rep
for i in range(K,N):
    tmp = rep*A[i]//A[i-K]
    tmp %= mod
    if tmp > rep:
        print("Yes")
    else:
        print("No")
    rep = tmp

Submission status: Wrong Answer

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

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

Submission status: Time Limit Exceeded

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

L = N-K+1
prev = sum(A[:K])
for i in range(1, L):
    score = sum(A[i:i+K])
    if prev < score:
        print("Yes")
    else:
        print("No")
    prev = score

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]
#print(mae)
for j in range(k,n):
    #print(a[j-k],a[j])
    if mae < (mae // a[j-k]) * a[j]:
        print('Yes')
    else:
        print('No')
    mae = (mae // a[j-k]) * a[j]

Submission status: Time Limit Exceeded

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

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

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

Submission status: Time Limit Exceeded

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

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

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

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

check = scores[0]

for k in range(1, N-K+1):
    if scores[k-1] < scores[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()))
X = []
ans = 1
for i in range(K):
    ans = ans*A[i]
X.append(ans)

for i in range(K+1,N+1):
    ans = (ans//A[i-1-K])*A[i-1]
    X.append(ans)
for i in range(N-K):
    if X[i] < X[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()))
X = []
for i in range(K,N+1):
    ans = 1
    for j in range(i-K,i):
        ans = ans*A[j]
    X.append(ans)
for i in range(N-K):
    if X[i] < X[i+1]:
        print("Yes")
    else:
        print("No")

Submission status: Time Limit Exceeded

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

i = 0
score = 1
b_score = None
while i < n:
    score *= a_l[i]
    if i > k-1:
        score = int(score/a_l[i-k])
    if b_score is not None:
        if score > b_score:
            print('Yes')
        else:
            print('No')
    if i >= k-1:
        b_score = score
    i+=1

Submission status: Time Limit Exceeded

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

i = 0
test = []
b = None
while i < n:
    test.append(a_l[i])
    if len(test) > k:
        test = test[len(test)-k:]
    if len(test) == k:
        p = 1
        for m in test:
            p *= m
        if b is not None:
            if p > b:
                print('Yes')
            else:
                print('No')
        b = p
    i+=1

Submission status: Time Limit Exceeded

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

score = 1
before_score = -1
for i in range(len(argList)):
    
    if i < k-1:        
        score = score*argList[i]
    else:
        score = score*argList[i]/argList[i-k]
        if before_score == -1:
            before_score = score
        else:
            if before_score < score:
                print('Yes')
            else:
                print('No')
            before_score = score

Submission status: Time Limit Exceeded

Solution code:
n, k = map(int, input().split())  
argList = list(map(int, input().split()))
before_score = -1
for i in range(k, n+1):
    #print(i)
    if before_score != -1:
        curr_score = 1
        for x in [argList[i] for i in range(i-k, i)]:
            #print(x)
            curr_score = curr_score * x
        #print(curr_score)
        if curr_score > before_score:
            print('Yes')
        else:
            print('No')
        before_score = curr_score

    else:
        before_score = 1
        for x in [argList[i] for i in range(i-k, i)]:
            before_score = before_score * x

Submission status: Time Limit Exceeded

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

evals = []
eval = scores[0:k]
for i in range(k, n, 1):
    new = scores[i-k+1:i+1]
    if eval[0] < new[-1]:
        evals.append('Yes')
    else:
        evals.append('No')
    eval = new

for ans in evals:
    print(ans)

Submission status: Time Limit Exceeded

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

evals = []
for i in range(k-1, n, 1):
    eval = scores[i+1-k:i+1]
    sum = 1
    for j in eval:
        sum *= j
    evals.append(sum)

for k in range(1, len(evals), 1):
    print('Yes' if evals[k-1] < evals[k] else 'No')

Submission status: Time Limit Exceeded

Solution code:
import functools
import operator

n, k = map(int, input().split())
a = [int(s) for s in input().split()]
vals = []
for i in range(k - 1, n):
    vals.append(functools.reduce(operator.mul, a[i - k + 1:i + 1]))

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

Submission status: Time Limit Exceeded

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

last_val = 1
for i in range(k - 1, n):
    val = 1
    for j in range(k):
        val *= a[i - j]
    if i >= k:
        if i >= k and val > last_val:
            print('Yes')
        else:
            print('No')
    last_val = val

Submission status: Time Limit Exceeded

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


for i in range(n):

  if i < k-1:
    continue
  else:
    ans = 1
    for x in range(k):
      ans *= lis[i-x]

    lis_score.append(ans)


for y in range(len(lis_score)-1):

  if lis_score[y] < lis_score[y+1]:
    print("Yes")
  else:
    print("No")

Submission status: Time Limit Exceeded

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

    products = 1
    for result in results[:k]:
        products *= result
    for i in range(n-k):
        new_products = products * results[i+k] / results[i]
        if products < new_products:
            print('Yes')
        else:
            print('No')
        products = new_products


if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

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

    products = 1
    for result in results[:k]:
        products *= result
    for i in range(n-k):
        new_products = products * results[i+k] / results[i]
        if products < products*results[i+k]/results[i]:
            print('Yes')
        else:
            print('No')
        products = new_products


if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

sum = []

s = 1
for i in range(k):
    s *= a[i]
sum.append(s)

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

for i in range(n-k):
    i += 1
    if sum[i] > sum[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()))

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

for i in range(n-k):
    if hyoten[i+1] > hyoten[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()))
cnt = 1
for i in range(n):
    cnt*=a[i]
    if i>=k:
        m = cnt//a[i]
        cnt//=a[i-k]
        if cnt>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()))
score=[0]*(n-k+1)
for i in range(k-1,n):
    score[i-k+1]=1
    for j in range(k):
        score[i-k+1]*=a[i-j]
for i in range(1,n-k+1):
    if score[i-1]<score[i]:
        print('Yes')
    else:
        print('No')

Submission status: Time Limit Exceeded

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

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

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

Submission status: Time Limit Exceeded

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

n, k = map(int, input().split())
*a, = map(int, input().split())
p = 1
for i in range(k):
	p *= a[i]
for i in range(k, n):
	q = p * a[i] // a[i - k]
	if q > p:
		print('Yes')
	else:
		print('No')
	p = q

Submission status: Time Limit Exceeded

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

calc = []
cur = 1

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

i = k - 1
while i < n:
    cur = cur * a[i]
    calc.append(cur)
    cur = cur / a[i - k + 1]
    i += 1


n = len(calc)
i = 1
while i < n:
    if calc[i] > calc[i - 1]:
        print("Yes")
    else:
        print("No")
    i += 1

Submission status: Time Limit Exceeded

Solution code:
# cook your dish here
n,k=input().split()
n=int(n)
k=int(k)
l=list(map(int,input().split()))
m=[]
for j in range(n):
    s=1
    for i in range(j,j+k):
        s=s*l[i]
    if len(m)!=0:
        if s>m[-1]:
            print("Yes")
        else:
            print("No")
    m.append(s)        
                
    if j+k==n:
        break

Submission status: Time Limit Exceeded

Solution code:
from functools import reduce
N, K = map(int, input().split())
A = list(map(int, input().split()))
A.insert(0, 1)
N = N + 1
K = K + 1
si = 0
ei = K - 1
before = reduce(lambda x, y: (x * y), A[si:ei])
after = before / A[si] * A[ei]
for _ in range(N - K):
  si = si + 1
  ei = ei + 1
  before = after
  after = after / A[si] * A[ei]
  if before < after:
    print("Yes")
  else:
    print("No")

Submission status: Time Limit Exceeded

Solution code:
ni = lambda: int(input())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))

n,k=nm()
a=nl()
b=[1]*(n+1)

for i in range(n):
  b[i+1] = a[i]*b[i]

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

Submission status: Time Limit Exceeded

Solution code:
ni = lambda: int(input())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))

n,k=nm()
a=nl()
b=[1]*(n+1)

for i in range(n):
  b[i+1] = a[i]*b[i]

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

Submission status: Time Limit Exceeded

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

N = int(N)
K = int(K)
SCORES = 1
answer = []
for i in range(K-1,N):
    for j in range(i,i-(K),-1):
        SCORES *= scores[j]
        
    answer.append(SCORES)
    SCORES = 1
    
#print(answer)

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