Buggy python submission (verdict: Time Limit Exceeded):
# coding: utf-8
import sys
#from operator import itemgetter
sysread = sys.stdin.buffer.readline
read = sys.stdin.buffer.read
#from heapq import heappop, heappush
from collections import defaultdict
sys.setrecursionlimit(10**7)
import math
#from itertools import product, accumulate, combinations, product
#import bisect# lower_bound etc
#import numpy as np
#from copy import deepcopy
#from collections import deque


def run():
    N, K, *A = map(int, read().split())
    A = [-1] + A
    INF = 1 << 50
    X = [INF, 1, 1]
    for i, a in enumerate(A[1:], 1):
        pre = X[1]
        if i <= K:
            if a == 0:
                X[0] = i
                X[1] = 0
                X[2] = 1
                continue

            X[1] *= a
            X[2] *= a
        if i > K:
            if a == 0:
                X[0] = i
                X[1] = 0
                X[2] = 1
                continue
            if i - K == X[0]:
                X[0] = INF
                X[1] = X[2]
            elif A[i-K] == 0:
                pass
            else:
                X[1] /= A[i-K]
            X[1] *= a
            X[2] *= a
            if pre < X[1]:
                print('Yes')
            else:
                print('No')


if __name__ == "__main__":
    run()

Fixed submission:
# coding: utf-8
import sys
#from operator import itemgetter
sysread = sys.stdin.buffer.readline
read = sys.stdin.buffer.read
#from heapq import heappop, heappush
from collections import defaultdict
sys.setrecursionlimit(10**7)
import math
#from itertools import product, accumulate, combinations, product
#import bisect# lower_bound etc
#import numpy as np
#from copy import deepcopy
#from collections import deque


def run():
    N, K, *A = map(int, read().split())
    A = [-1] + A
    INF = 1 << 50
    X = [INF, 1, 1]
    for i in range(K, N):
        if A[i+1] > A[i-K+1]:
            print('Yes')
        else:
            print('No')




if __name__ == "__main__":
    run()

Buggy python submission (verdict: Time Limit Exceeded):
# coding: utf-8
import sys
#from operator import itemgetter
sysread = sys.stdin.buffer.readline
read = sys.stdin.buffer.read
#from heapq import heappop, heappush
from collections import defaultdict
sys.setrecursionlimit(10**7)
import math
#from itertools import product, accumulate, combinations, product
#import bisect# lower_bound etc
#import numpy as np
#from copy import deepcopy
#from collections import deque


def run():
    N, K, *A = map(int, read().split())
    A = [-1] + A
    INF = 1 << 50
    X = [INF, 1, 1]
    for i, a in enumerate(A[1:], 1):
        pre = X[1]
        if i <= K:
            if a == 0:
                X[0] = i
                X[1] = 0
                X[2] = 1
                continue

            X[1] *= a
            X[2] *= a
        if i > K:
            if a == 0:
                X[0] = i
                X[1] = 0
                X[2] = 1
                continue
            if i - K == X[0]:
                X[0] = INF
                X[1] = X[2]
            elif A[i-K] == 0:
                pass
            else:
                X[1] /= A[i-K]
            X[1] *= a
            X[2] *= a
            if pre < X[1]:
                print('Yes')
            else:
                print('No')


if __name__ == "__main__":
    run()

Fixed submission:
# coding: utf-8
import sys
#from operator import itemgetter
sysread = sys.stdin.buffer.readline
read = sys.stdin.buffer.read
#from heapq import heappop, heappush
from collections import defaultdict
sys.setrecursionlimit(10**7)
import math
#from itertools import product, accumulate, combinations, product
#import bisect# lower_bound etc
#import numpy as np
#from copy import deepcopy
#from collections import deque


def run():
    N, K, *A = map(int, read().split())
    A = [-1] + A
    INF = 1 << 50
    X = [INF, 1, 1]
    for i in range(K, N):
        if A[i+1] > A[i-K+1]:
            print('Yes')
        else:
            print('No')




if __name__ == "__main__":
    run()