Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int, input().split())
ab = sorted(list(map(int, input().split())) for _ in range(m))


def dfs(now, count):
    if count > 2:
        pass
    elif visit[n] == 0:
        visit[now] = 1
        for x in graph[now]:
            dfs(x, count + 1)


flag = False
if ab[0][0] == 1:
    graph = [[] for _ in range(n + 1)]
    for a, b in ab:
        graph[a].append(b)
        graph[b].append(a)

    visit = [0] * (n + 1)
    visit[1] = 1

    dfs(1, 0)

    if visit[n] == 1:
        flag = True

print('POSSIBLE') if flag else print('IMPOSSIBLE')


Fixed submission:
n, m = map(int, input().split())
ab = sorted(list(map(int, input().split())) for _ in range(m))


def dfs(now, count):
    if count <= 2 and visit[n] == 0:
        visit[now] = 1
        if count <= 1:
            for x in graph[now]:
                dfs(x, count + 1)


flag = False
if ab[0][0] == 1:
    graph = [[] for _ in range(n + 1)]
    for a, b in ab:
        graph[a].append(b)
        graph[b].append(a)

    visit = [0] * (n + 1)
    dfs(1, 0)

    if visit[n] == 1:
        flag = True

print('POSSIBLE') if flag else print('IMPOSSIBLE')

Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int, input().split())
ab = sorted(list(map(int, input().split())) for _ in range(m))


def dfs(now, count):
    if count > 2:
        pass
    else:
        visit[now] = 1
        for x in graph[now]:
            dfs(x, count + 1)


flag = False
if ab[0][0] == 1:
    graph = [[] for _ in range(n + 1)]
    for a, b in ab:
        graph[a].append(b)
        graph[b].append(a)

    visit = [0] * (n + 1)
    visit[1] = 1

    dfs(1, 0)

    if visit[n] == 1:
        flag = True

print('POSSIBLE') if flag else print('IMPOSSIBLE')


Fixed submission:
n, m = map(int, input().split())
ab = sorted(list(map(int, input().split())) for _ in range(m))


def dfs(now, count):
    if count <= 2 and visit[n] == 0:
        visit[now] = 1
        if count <= 1:
            for x in graph[now]:
                dfs(x, count + 1)


flag = False
if ab[0][0] == 1:
    graph = [[] for _ in range(n + 1)]
    for a, b in ab:
        graph[a].append(b)
        graph[b].append(a)

    visit = [0] * (n + 1)
    dfs(1, 0)

    if visit[n] == 1:
        flag = True

print('POSSIBLE') if flag else print('IMPOSSIBLE')
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))

ans = 10 ** 10
for i in range(n - 1):
    x = sum(a[:i + 1])
    y = sum(a[i + 1:])
    ans = min(ans, abs(x - y))

print(ans)


Fixed submission:
n = int(input())
a = list(map(int, input().split()))

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

ans = 10 ** 10
for i in range(1, n):
    x = cumsum[i]
    y = cumsum[n] - x
    ans = min(ans, abs(x - y))

print(ans)
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(n)]
cd = [list(map(int, input().split())) for _ in range(n)]

for a, b in ab:
    ans = 10 ** 10
    dist = 10 ** 10
    for i in range(n):
        c, d = cd[i]
        temp = abs(a - c) + abs(b - d)
        if dist > temp:
            dist = temp
            ans = i + 1
    print(ans)


Fixed submission:
n, m = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(n)]
cd = [list(map(int, input().split())) for _ in range(m)]

for a, b in ab:
    ans = 10 ** 10
    dist = 10 ** 10
    for i in range(m):
        c, d = cd[i]
        temp = abs(a - c) + abs(b - d)
        if dist > temp:
            dist = temp
            ans = i + 1
    print(ans)

Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(n)]
cd = [list(map(int, input().split())) for _ in range(n)]

for a, b in ab:
    ans = 10 ** 10
    dist = 10 ** 10
    for i in range(n):
        c, d = cd[i]
        temp = abs(a - c) + abs(b - d)
        if dist > temp:
            dist = temp
            ans = i + 1
    print(ans)


Fixed submission:
n, m = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(n)]
cd = [list(map(int, input().split())) for _ in range(m)]

for a, b in ab:
    ans = 10 ** 10
    dist = 10 ** 10
    for i in range(m):
        c, d = cd[i]
        temp = abs(a - c) + abs(b - d)
        if dist > temp:
            dist = temp
            ans = i + 1
    print(ans)
Buggy python submission (verdict: Runtime Error):
w, a, b = map(int, input().split())

if b > a + w:
    print(b - a - w)
elif b + w < a:
    print(a - b - w)
else:
    print(0)
w, a, b = map(int, input().split())

if b > a + w:
    print(b - a - w)
elif b + w < a:
    print(a - b - w)
else:
    print(0)


Fixed submission:
w, a, b = map(int, input().split())

if b > a + w:
    print(b - a - w)
elif b + w < a:
    print(a - b - w)
else:
    print(0)
Buggy python submission (verdict: Time Limit Exceeded):
k, s = map(int, input().split())

ans = 0
for x in range(k + 1):
    for y in range(min(k + 1, s - x + 1)):
        for z in range(min(k + 1, s - x - y + 1)):
            if x + y + z == s:
                ans += 1

print(ans)


Fixed submission:
k, s = map(int, input().split())

ans = 0
for x in range(k + 1):
    for y in range(k + 1):
        if 0 <= s - x - y <= k:
            ans += 1

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
k, s = map(int, input().split())

ans = 0
for x in range(k + 1):
    for y in range(k + 1):
        for z in range(k + 1):
            if x + y + z == s:
                ans += 1

print(ans)


Fixed submission:
k, s = map(int, input().split())

ans = 0
for x in range(k + 1):
    for y in range(k + 1):
        if 0 <= s - x - y <= k:
            ans += 1

print(ans)
Buggy python submission (verdict: Runtime Error):
a, b, c = map(int, input().split())

if a + b == c or b + c == a or c + a == b:
    print('Yes')
else:
    print('No')
a, b, c = map(int, input().split())

if a + b == c or b + c == a or c + a == b:
    print('Yes')
else:
    print('No')


Fixed submission:
a, b, c = map(int, input().split())

if a + b == c or b + c == a or c + a == b:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Time Limit Exceeded):
n, a = map(int, input().split())
x = list(map(int, input().split()))

dp = [[[0] * (50 * (n + 10)) for _ in range(n + 10)] for _ in range(n + 10)]
dp[0][0][0] = 1

for i in range(n):
    for use in range(n):
        for total in range(n * a):
            dp[i + 1][use][total] += dp[i][use][total]
            dp[i + 1][use + 1][total + x[i]] += dp[i][use][total]

ans = 0
for i in range(1, n + 1):
    ans += dp[n][i][a * i]

print(ans)


Fixed submission:
n, a = map(int, input().split())
x = list(map(int, input().split()))

dp = [[[0] * (50 * (n + 10)) for _ in range(n + 10)] for _ in range(n + 10)]
dp[0][0][0] = 1

for i in range(n):
    for use in range(n):
        for total in range(n * a):
            if dp[i][use][total]:
                dp[i + 1][use][total] += dp[i][use][total]
                dp[i + 1][use + 1][total + x[i]] += dp[i][use][total]

ans = 0
for i in range(1, n + 1):
    ans += dp[n][i][a * i]

print(ans)

Buggy python submission (verdict: Runtime Error):
n, a = map(int, input().split())
x = list(map(int, input().split()))

dp = [[[0] * 3000 for _ in range(50)] for _ in range(50)]
dp[0][0][0] = 1

for i in range(n):
    for j in range(n):
        for k in range(n * a):
            dp[i + 1][j][k] += dp[i][j][k]
            dp[i + 1][j + 1][k + x[i]] += dp[i][j][k]

ans = 0
for i in range(1, n):
    ans += dp[n][i][a * i]

print(ans)


Fixed submission:
n, a = map(int, input().split())
x = list(map(int, input().split()))

dp = [[[0] * (50 * (n + 10)) for _ in range(n + 10)] for _ in range(n + 10)]
dp[0][0][0] = 1

for i in range(n):
    for use in range(n):
        for total in range(n * a):
            if dp[i][use][total]:
                dp[i + 1][use][total] += dp[i][use][total]
                dp[i + 1][use + 1][total + x[i]] += dp[i][use][total]

ans = 0
for i in range(1, n + 1):
    ans += dp[n][i][a * i]

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n, a = map(int, input().split())
x = list(map(int, input().split()))

ans = 0
for i in range(2 ** n):
    pattern = [0] * n
    for j in range(n):
        if i >> j & 1:
            pattern[j] = 1

    val = 0
    for k in range(n):
        if pattern[k] == 1:
            val += x[k]

    if val != 0 and sum(pattern) != 0:
        if val / sum(pattern) == a:
            ans += 1

print(ans)


Fixed submission:
n, a = map(int, input().split())
x = list(map(int, input().split()))

dp = [[[0] * (50 * (n + 10)) for _ in range(n + 10)] for _ in range(n + 10)]
dp[0][0][0] = 1

for i in range(n):
    for use in range(n):
        for total in range(n * a):
            if dp[i][use][total]:
                dp[i + 1][use][total] += dp[i][use][total]
                dp[i + 1][use + 1][total + x[i]] += dp[i][use][total]

ans = 0
for i in range(1, n + 1):
    ans += dp[n][i][a * i]

print(ans)
Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
d = list(map(int, input().split()))

keta = int(len(str(n)))
ok = sorted(list(set(d) ^ {1, 2, 3, 4, 5, 6, 7, 8, 9, 0}))

ans = ''
for i in reversed(range(keta)):
    val = int(str(n)[i])
    candidate = [j for j in ok if j >= val]
    if candidate:
        ans += str(min(candidate))
    else:
        ans = str(min(ok))

ans = ''.join(reversed(list(ans)))
if int(ans) < n:
    idx = ok.index(ans[0])
    if idx == len(ok) - 1:
        ans = str(min(ok)) * (keta + 1)
    else:
        ans = str(ok[idx + 1]) + str(min(ok)) * (keta - 1)

print(ans)


Fixed submission:
n, k = map(int, input().split())
d = set(input().split())

while set(list(str(n))) & d != set():
    n += 1

print(n)

Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
d = list(map(int, input().split()))

ok = sorted(list(set(d) ^ {1, 2, 3, 4, 5, 6, 7, 8, 9, 0}))

ans = ''
for i in range(len(str(n))):
    flag = False
    num = int(str(n)[i])
    candidate = [j for j in ok if j >= num]
    if candidate:
        ans += str(min(candidate))
    else:
        ans += min(ok)
        flag = True

if flag:
    ans[0] = str(min([i for i in ok if i > ans[0]]))

print(ans)


Fixed submission:
n, k = map(int, input().split())
d = set(input().split())

while set(list(str(n))) & d != set():
    n += 1

print(n)

Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
d = list(map(int, input().split()))

ok = sorted(list(set(d) ^ {1, 2, 3, 4, 5, 6, 7, 8, 9, 0}))

ans = ''
for i in range(len(str(n))):
    num = int(str(n)[i])
    ans += str(min([j for j in ok if j >= num]))

print(ans)


Fixed submission:
n, k = map(int, input().split())
d = set(input().split())

while set(list(str(n))) & d != set():
    n += 1

print(n)
Buggy python submission (verdict: Runtime Error):
x, y = map(int, input().split())
ans = 'No'
for a in range(x+1):
    b = x-a
    if 2*a+4*b == Y:
        ans = 'Yes'

print(ans)

Fixed submission:
x, y = map(int, input().split())
ans = 'No'
for a in range(x+1):
    b = x-a
    if 2*a+4*b == y:
        ans = 'Yes'

print(ans)
Buggy python submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline
N = int(input())
A = map(int, input().split())
S = 0
S2 = 0
M = 10**9+7
for a in A:
  S += a
  S %= M
  S2 += a*a
  S2 %= M

# (S * S - S2)/2 
ans = (S * S - S2) * pow(2, -1, M)
ans %= M
print(ans)

Fixed submission:
import sys
input = sys.stdin.readline
N = int(input())
A = map(int, input().split())
S = 0
S2 = 0
M = 10**9+7
for a in A:
  S += a
  S %= M
  S2 += a*a
  S2 %= M

# (S * S - S2)/2 
ans = (S * S - S2) * pow(2, -1, M)
ans %= M
print(ans)
Buggy python submission (verdict: Runtime Error):
import numpy as np
import time
import random
import collections
import bisect  

start = time.time()

def insert(list, n): 
    bisect.insort(list, n)  
    return list

def read_input():
  D = int(input())
  c = list(map(int, input().split()))
  s = [list(map(int, input().split())) for _ in range(D)]
  return D, c, s
D, c, s = read_input()

c = np.array(c)
s = np.array(s)
tests = np.argmax(s, axis=1)

def get_dates_for_tests(tests):
  dates_for_tests = [list([-1]) for _ in range(26)]
  for i, t in enumerate(tests):
    dates_for_tests[t].append(i)
  for t in range(26):
    dates_for_tests[t].append(D)
  return dates_for_tests

dates_for_tests = get_dates_for_tests(tests)

def get_score(tests):
  dates_for_tests = get_dates_for_tests(tests)
  score = 0
  d = np.zeros(26, dtype=np.int64)
  for selected, S in zip(tests, s):
    d += 1
    d[selected] = 0
    score += S[selected] - (c * d).sum()
  return score

def score_diff(date, test):
  #print(date, test)
  before = tests[date]
  if test == before:
    return 0, None, None
  pos_diff = s[date, test] - s[date, before]
  new_index = bisect.bisect_left(dates_for_tests[test], date, 1)
  new_diff = c[test] * (dates_for_tests[test][new_index] - date) * (date - dates_for_tests[test][new_index-1])

  old_index = bisect.bisect_left(dates_for_tests[before], date, 1)
  #print(c[test], dates_for_tests[test])
  #print(c[before], dates_for_tests[before])
  old_diff = c[before] * (dates_for_tests[before][old_index+1] - date) * (date - dates_for_tests[before][old_index-1])
  
  total_diff = pos_diff + new_diff - old_diff
  #print(test, total_diff, pos_diff, new_diff, -old_diff)
  return total_diff, new_index, old_index

# current_score = get_score(tests)
while time.time() < start + 1.8:
  t = time.time()
  for date in range(D):
    for test in range(26):
      # date = 4
      # test = 23

      total_diff, new_index, old_index= score_diff(date, test)
      to_update = total_diff > 0
      if t < start + 1.6 and total_diff > -5000:
        to_update += random.randrange(5) == 0
      if to_update:
        # print('INCREASING')
        #print(date, tests[date], test)
        #print(c[[tests[date], test]])
        #print(s[date, [tests[date], test]])
        del dates_for_tests[tests[date]][old_index]
        insert(dates_for_tests[test], date)
        tests[date] = test

        #assert dates_for_tests == get_dates_for_tests(tests)
        #new_score = get_score(tests)
        #print(total_diff, new_score - current_score , current_score, new_score) 
        #assert new_score == current_score + total_diff
        #current_score = new_score
        # raise ValueError
        
# print(get_score(tests))
for t in tests:
  print(t+1)


Fixed submission:
import numpy as np
def read_input():
  D = int(input())
  c = list(map(int, input().split()))
  s = [list(map(int, input().split())) for _ in range(D)]
  return D, c, s
D, c, s = read_input()

for t in np.array(s).argmax(axis=1)+1:
  print(t)
Buggy python submission (verdict: Runtime Error):
import itertools
N = int(input())
A = list(map(int, input().split()))
count = {}
for a in A:
  if a not in count:
    count[a] = 0
  count[a] += 1

def check(a):
  if count[a] > 1:
    return 0

  if 1 in count:
    if a == 1 and count[1] == 1:
      return 1
    return 0

  #print(a)
  ok = True
  sqr_a = 1 + int(a**0.5)
  for s in itertools.chain([2], range(3, sqr_a, 2)):
    if a % s:
      continue
    c = s
    while c < sq_a:
      if a % c == 0 and (c in count or (a//c) in count):
        #print(a, c)
        ok = False
        break
      c *= 2
  return ok
  
ans = 0
for a in A:
  ans += check(a)
print(ans)
    
    



Fixed submission:
import itertools
N = int(input())
A = list(map(int, input().split()))
count = {}
for a in A:
  if a not in count:
    count[a] = 0
  count[a] += 1

def check(a):
  if count[a] > 1:
    return 0

  if 1 in count:
    if a == 1 and count[1] == 1:
      return 1
    return 0

  #print(a)
  ok = True
  sqr_a = 1 + int(a**0.5)
  for s in itertools.chain([2], range(3, sqr_a, 2)):
    if a % s:
      continue
    c = s
    while c < sqr_a:
      if a % c == 0 and (c in count or (a//c) in count):
        #print(a, c)
        ok = False
        break
      c *= 2
  return ok
  
ans = 0
for a in A:
  ans += check(a)
print(ans)

Buggy python submission (verdict: Runtime Error):
import itertools
N = int(input())
A = list(map(int, input().split()))
count = {}
for a in A:
  if a not in count:
    count[a] = 0
  count[a] += 1

  

def check(a):
  if count[a] > 1:
    return 0

  if 1 in count:
    if a == 1 and count[1] == 1:
      ans += 1
    return 0

  #print(a)
  ok = True
  sq_a = 1 + int(a**0.5)
  for s in itertools.chain([2], range(3, 1+int(a**0.5), 2)):
    c = s
    if a % c:
      continue
    while c < sq_a:
      if a % c == 0 and (c in count or (a//c) in count):
        #print(a, c)
        ok = False
        break
      c *= 2
  return ok
  
ans = 0
for a in A:
  ans += check(a)
print(ans)
    
    



Fixed submission:
import itertools
N = int(input())
A = list(map(int, input().split()))
count = {}
for a in A:
  if a not in count:
    count[a] = 0
  count[a] += 1

def check(a):
  if count[a] > 1:
    return 0

  if 1 in count:
    if a == 1 and count[1] == 1:
      return 1
    return 0

  #print(a)
  ok = True
  sqr_a = 1 + int(a**0.5)
  for s in itertools.chain([2], range(3, sqr_a, 2)):
    if a % s:
      continue
    c = s
    while c < sqr_a:
      if a % c == 0 and (c in count or (a//c) in count):
        #print(a, c)
        ok = False
        break
      c *= 2
  return ok
  
ans = 0
for a in A:
  ans += check(a)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import math

N, K = [int(x) for x in input().split()]
As = sorted([int(x) for x in input().split()])
Fs = sorted([int(x) for x in input().split()], reverse=True)

def in_n_sec(n):
  total_training = sum(max(0, a-int(n/f)) for a, f in zip(As, Fs))
  return total_training <= K
  
current_worst_confirmed = 10**12
current_best_possible = 0
while current_worst_confirmed > current_best_possible:
  to_try = (current_worst_confirmed + current_best_possible ) // 2
  if in_n_sec(to_try):
    current_worst_confirmed = to_try
  else:
    current_best_possible = to_try + 1
print(current_worst_confirmed)
    
  


Fixed submission:
import math

N, K = [int(x) for x in input().split()]
As = sorted([int(x) for x in input().split()])
Fs = sorted([int(x) for x in input().split()], reverse=True)

def in_n_sec(n):
  total_training = sum(max(0, a-int(n/f)) for a, f in zip(As, Fs))
  return total_training <= K
  
current_worst_confirmed = 10**12
current_best_possible = 0
while current_worst_confirmed > current_best_possible:
  to_try = (current_worst_confirmed + current_best_possible ) // 2
  if in_n_sec(to_try):
    current_worst_confirmed = to_try
  else:
    current_best_possible = to_try + 1
print(current_worst_confirmed)

Buggy python submission (verdict: Time Limit Exceeded):
import math

N, K = [int(x) for x in input().split()]
As = sorted([int(x) for x in input().split()])
Fs = sorted([int(x) for x in input().split()], reverse=True)

def in_n_sec(n):
  #print(n)
  #print(Fs)
  max_allowed = [int(n/F) for F in Fs]
  #print(max_allowed)
  #print(As)
  #print([max(0, a-ma) for a, ma in zip(As, max_allowed)])
  total_training = sum(max(0, a-ma) for a, ma in zip(As, max_allowed))
  #print(total_training)
  return total_training <= K
  
current_worst_confirmed = 10**12
current_best_possible = 0
while current_worst_confirmed > current_best_possible:
  #print(current_worst_confirmed, current_best_possible)
  to_try = (current_worst_confirmed + current_best_possible ) // 2
  if in_n_sec(to_try):
    current_worst_confirmed = to_try
  else:
    current_best_possible = to_try + 1
print(current_worst_confirmed)
    
  


Fixed submission:
import math

N, K = [int(x) for x in input().split()]
As = sorted([int(x) for x in input().split()])
Fs = sorted([int(x) for x in input().split()], reverse=True)

def in_n_sec(n):
  total_training = sum(max(0, a-int(n/f)) for a, f in zip(As, Fs))
  return total_training <= K
  
current_worst_confirmed = 10**12
current_best_possible = 0
while current_worst_confirmed > current_best_possible:
  to_try = (current_worst_confirmed + current_best_possible ) // 2
  if in_n_sec(to_try):
    current_worst_confirmed = to_try
  else:
    current_best_possible = to_try + 1
print(current_worst_confirmed)
Buggy python submission (verdict: Runtime Error):
a, b, c = map(int, input())
if b - a == c - b:
  print('YES')
else:
  print('NO')

Fixed submission:
a, b, c = map(int, input().split())
if b - a == c - b:
  print('YES')
else:
  print('NO')
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))

ans = 0
mod = 10**9 + 7

for i in range(N):
    num = 0
    for j in range(i+1, N):
        num += A[j]
    ans += A[i] * num

print(ans % mod)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))

ans = 0
mod = 10 ** 9 + 7
num = sum(A)

for a in A:
    num -= a
    ans += a * num

print(ans % mod)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
ans = 0
mod = 10**9 + 7

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

print(ans % mod)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))

ans = 0
mod = 10 ** 9 + 7
num = sum(A)

for a in A:
    num -= a
    ans += a * num

print(ans % mod)
Buggy python submission (verdict: Time Limit Exceeded):
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

Fixed submission:
N, K = map(int, input().split())
A = list(map(int, input().split()))

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

Buggy python submission (verdict: Time Limit Exceeded):
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')


Fixed submission:
N, K = map(int, input().split())
A = list(map(int, input().split()))

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