Buggy python submission (verdict: Time Limit Exceeded):
from sys import stdin
input = stdin.readline


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

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

  pre = S[K]/S[0]
  out = []
  for i in range(K+1, N+1):
    temp = S[i]/S[i-K]
    if pre < temp:
      # print('Yes')
      out.append('Yes')
    else:
      # print('No')
      out.append('No')
    pre = temp

  print(*out, sep='\n')


if(__name__ == '__main__'):
  main()


Fixed submission:
from sys import stdin
input = stdin.readline


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

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

  # pre = S[K]/S[0]
  # out = []
  for i in range(K+1, N+1):
    if A[i-K-1] < A[i-1]:
      print('Yes')
    else:
      print('No')
    # temp = S[i]/S[i-K]
    # if pre < temp:
    #   # print('Yes')
    #   out.append('Yes')
    # else:
    #   # print('No')
    #   out.append('No')
    # pre = temp

  # print(*out, sep='\n')


if(__name__ == '__main__'):
  main()

Buggy python submission (verdict: Time Limit Exceeded):
from sys import stdin
input = stdin.readline


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

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

  pre = S[K]/S[0]
  for i in range(K+1, N+1):
    temp = S[i]/S[i-K]
    if pre < S[i]/S[i-K]:
      print('Yes')
    else:
      print('No')
    pre = temp


if(__name__ == '__main__'):
  main()


Fixed submission:
from sys import stdin
input = stdin.readline


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

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

  # pre = S[K]/S[0]
  # out = []
  for i in range(K+1, N+1):
    if A[i-K-1] < A[i-1]:
      print('Yes')
    else:
      print('No')
    # temp = S[i]/S[i-K]
    # if pre < temp:
    #   # print('Yes')
    #   out.append('Yes')
    # else:
    #   # print('No')
    #   out.append('No')
    # pre = temp

  # print(*out, sep='\n')


if(__name__ == '__main__'):
  main()

Buggy python submission (verdict: Time Limit Exceeded):
from sys import stdin
input = stdin.readline


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

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

  score = []
  for i in range(K, N+1):
    score.append(S[i]/S[i-K])

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


if(__name__ == '__main__'):
  main()


Fixed submission:
from sys import stdin
input = stdin.readline


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

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

  # pre = S[K]/S[0]
  # out = []
  for i in range(K+1, N+1):
    if A[i-K-1] < A[i-1]:
      print('Yes')
    else:
      print('No')
    # temp = S[i]/S[i-K]
    # if pre < temp:
    #   # print('Yes')
    #   out.append('Yes')
    # else:
    #   # print('No')
    #   out.append('No')
    # pre = temp

  # print(*out, sep='\n')


if(__name__ == '__main__'):
  main()