Harryxun/sft_time huggingface dataset:
### BUGGY CODE ###

#coding:utf-8
N,Q = map(int,input().split())
rank = [0 for i in range(N)]

class Tree:
    def __init__(self,par,key):
        self.par = par
        self.key = key

List = [Tree(i,i) for i in range(N)]
for i in range(Q):
    com, x,y = map(int,input().split())
    while type(x) != int or List[x].par != x:
        x = List[x].par.key
    a = rank[x]
            
    while type(y) != int or List[y].par != y:
        y = List[y].par.key
    b = rank[y]

    if com == 0:
        if a <= b:
            if a == b:
                rank[x] += 1
            List[y].par = List[x]
            
        else:
            List[x].par = List[y]

    else:
        if x == y:
            print("1")
        else:
            print("0")




### FIXED CODE ###

#coding:utf-8
import time

N,Q = map(int,input().split())
rank = [0 for i in range(N)]

class Tree:
    def __init__(self,par,key):
        self.par = par
        self.key = key

List = [Tree(i,i) for i in range(N)]

def unit(x,y):
    while List[x].par != x:
        x = List[x].par
    a = rank[x]
            
    while List[y].par != y:
        y = List[y].par
    b = rank[y]
    if a <= b:
        if a == b:
            rank[x] += 1
        List[y].par = x
    else:
        List[x].par = y



def Find(x,y):
    Q = []
    P = []
    while List[x].par != x:
        x = List[x].par
        Q.append(x)
            
    while List[y].par != y:
        y = List[y].par
        P.append(y)
    for xi in Q:
        List[xi].par = x
        rank[xi] = 1
    for yi in P:
        List[yi].par = y
        rank[yi] = 1
    if x == y:
        print(1)
    else:
        print(0)
    
        
for i in range(Q):
    com, x,y = map(int,input().split())

    if com == 0:
        unit(x,y)
            
    else:
        Find(x,y)
### BUGGY CODE ###

n = int(input())
s = input()
list_count = []

for i in range(n):
    ce = s[i+1:].count('E')
    cw = s[:i].count('W')
    cnt = ce + cw
    list_count.append(cnt)

print(min(list_count))

### FIXED CODE ###

n = int(input())
s = list(input())
cnt = 0
ans_list = [0]
e_cnt = 0

for i in range(1,n):
    if s[i-1] == "E" and s[i] == "E":
        cnt -= 1
        e_cnt += 1
    if s[i-1] == "E" and s[i] == "W":
        cnt -= 0
    if s[i-1] == "W" and s[i] == "E":
        cnt += 0
        e_cnt += 1
    if s[i-1] == "W" and s[i] == "W":
        cnt += 1
    ans_list.append(cnt)

print(min(ans_list) + e_cnt)
### BUGGY CODE ###

from collections import deque
n, q = map(int, input().split())
g = [[] for i in range(n+1)]
point = [0 for i in range(n+1)]
for i in range(n-1):
    a, b = map(int, input().split())
    g[a].append(b)
    g[b].append(a)
for i in range(q):
    p, x = map(int, input().split())
    point[p] += x

q = deque([[1,0]])
for j in range(n):
    now = q.pop()
    point[now[0]] += point[now[1]]
    for i in range(len(g[now[0]])):
        if g[now[0]][i]==now[1]:
            continue
        q.append([g[now[0]][i],now[0]])
for i in range(1, n+1):
    print(point[i], end='')
    if i!=n:
        print(' ', end='')


### FIXED CODE ###

def main():
    from collections import deque
    n, q = map(int, input().split())
    g = [[] for i in range(n+1)]
    point = [0 for i in range(n+1)]
    for i in range(n-1):
        a, b = map(int, input().split())
        g[a].append(b)
        g[b].append(a)
    for i in range(q):
        p, x = map(int, input().split())
        point[p] += x

    q = deque([[1,0]])
    for j in range(n):
        now = q.pop()
        point[now[0]] += point[now[1]]
        for i in g[now[0]]:
            if i==now[1]:
                continue
            q.append([i,now[0]])
    for i in range(1, n+1):
        print(point[i], end='')
        if i!=n:
            print(' ', end='')

if __name__ == '__main__':
    main()
### BUGGY CODE ###

n,q = map(int,input().split())
s = str(input())
ls = [list(map(int,input().split())) for _ in range(q)]
c = 0
a = [-1]*10**5
for i in range(n-1):
    if s[i] == "A":
        if s[i+1] == "C":
            a[i] = i
a = list(set(a))
a.sort()
del a[0]
for j in range(q):
    (u,t) = (ls[j][0],ls[j][1])
    for k in a:
        if (k >= u-1) and (k <= t-2):
            c += 1
    print(c)
    c = 0

### FIXED CODE ###

n,q = map(int,input().split())
s = str(input())
a = [0]
for i in range(1,n):
    if s[i-1] == "A" and s[i] == "C":
        a.append(a[-1]+1)
    else:
        a.append(a[-1])
for j in range(q):
    u,t = map(int,input().split())
    print(a[t-1]-a[u-1])
### BUGGY CODE ###

N = int(input())

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

total = a[0]
for i in range(1,N):
    total *= a[i]
if  10 ** 18 < total:
    print(-1)
else:
    print(total)


### FIXED CODE ###

N = int(input())

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

a.sort()

if a[0] == 0:
    print(0)
    exit()

total = a[0]

for i in range(1,N):
    total *= a[i]
    if  10 ** 18 < total:
        print(-1)
        exit()
print(total)
### BUGGY CODE ###

import fractions

def isPrime(n):
    if n < 2:
    # 2未満は素数でない
        return False
    if n == 2:
    # 2は素数
        return True
    for p in range(2, n):
      if n % p == 0:
        # nまでの数で割り切れたら素数ではない
        return False
  # nまでの数で割り切れなかったら素数
    return True


A,B = map(int,input().split())
ans = fractions.gcd(A,B)
lists = []
cnt = 0
for i in range(1,ans+1):
    if (A % i == 0) and (B % i == 0):
        lists.append(i)
for i in lists:
    if isPrime(i):
        cnt += 1
print(cnt+1)

### FIXED CODE ###

import fractions
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

A,B = map(int,input().split())
ans = fractions.gcd(A,B)
lists = []
cnt = 0
ansr = prime_factorize(ans)
print(len(set(ansr))+1)
### BUGGY CODE ###

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

def factorization(n):
    arr = {}
    temp = n
    for i in range(2, int(-(-n ** 0.5 // 1)) + 1):
        if temp % i == 0:
            cnt = 0
            while temp % i == 0:
                cnt += 1
                temp //= i
            arr[i] = cnt

    if temp != 1:
        arr[temp] = 1

    if arr == []:
        arr[n] = 1

    return arr

ans = 0
for a in A:
    arr = factorization(a)
    if 2 in arr:
        ans += arr[2]
print(ans)


### FIXED CODE ###

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

def factorization(n):
    arr = {}
    temp = n
    i = 2
    if temp % i == 0:
        cnt = 0
        while temp % i == 0:
            cnt += 1
            temp //= i
        arr[i] = cnt

    return arr

ans = 0
for a in A:
    arr = factorization(a)
    if 2 in arr:
        ans += arr[2]
print(ans)
### BUGGY CODE ###

def shortest_path(s,n,w,es):
    #s→iの最短距離
    # s:始点, n:頂点数, w:辺の数, es[i]: [辺の始点,辺の終点,辺のコスト]
    d = [float("inf")] * n
    #d[i] : s→iの最短距離
    d[s] = 0
    for _ in range(n*w+1):
        updata = False
        for p,q,r in es:
            # e: 辺iについて [from,to,cost]
            if d[p] != float("inf") and d[q] > d[p] + r:
                d[q] = d[p] + r
                updata = True
        if not updata:
            break
    return d

def main():
    import sys
    input = sys.stdin.readline
    n,m,p = map(int,input().split())
    es = []
    for _ in range(m):
        a,b,c = map(int,input().split())
        es.append([a-1,b-1,p-c])

    d = shortest_path(0,n,m,es)

    kouho = d[-1]

    for _ in range(5):
        updata = True
        for i in range(m):
            e = es[i]
            # e: 辺iについて [from,to,cost]
            if d[e[0]] != float("inf") and d[e[1]] > d[e[0]] + e[2]:
                d[e[1]] = d[e[0]] + e[2]
                updata = True
        if not updata:
            break

    res = d[-1]

    if kouho == res:
        print(max(0,-res))
    else:
        print(-1)

if __name__ == '__main__':
    main()

### FIXED CODE ###

def shortest_path(s,n,w,es):
    #s→iの最短距離
    # s:始点, n:頂点数, w:辺の数, es[i]: [辺の始点,辺の終点,辺のコスト]
    d = [float("inf")] * n
    #d[i] : s→iの最短距離
    d[s] = 0
    for _ in [0]*n:
        update = False
        for p,q,r in es:
            # e: 辺iについて [from,to,cost]
            if d[p] != float("inf") and d[q] > d[p] + r:
                d[q] = d[p] + r
                update = True
        if not update:
            break
    return d

def main():
    import sys
    input = sys.stdin.readline
    n,m,p = map(int,input().split())
    es = []
    edge = [[] for _ in range(n)]

    for _ in range(m):
        a,b,c = map(int,input().split())
        es.append([a-1,b-1,p-c])
        edge[b-1].append(a-1)
    
    ren = [False]*n
    tank = [n-1]
    while len(tank) != 0:
        new = []
        for elt in tank:
            for go in edge[elt]:
                if ren[go]:
                    continue
                ren[go] = True
                new.append(go)
        tank = new

    d = shortest_path(0,n,m,es)

    for p,q,r in es:
        # e: 辺iについて [from,to,cost]
        if d[p] != float("inf") and d[q] > d[p] + r:
            d[q] = d[p] + r
            if ren[q]:
                print(-1)
                exit()

    print(max(-d[-1],0))

if __name__ == '__main__':
    main()
### BUGGY CODE ###

def warshall_floyd(d,n):
    for k in range(n):
        for i in range(n):
            for j in range(n):
                d[i][j] = min(d[i][j],d[i][k]+d[k][j])
    return d
    
n,m,r = map(int,input().split())
lstr = list(map(int,input().split()))

g = [[float("inf")]*n for _ in range(n)]
for i in range(m):
    a,b,c = map(int,input().split())
    g[a-1][b-1] = c
    g[b-1][a-1] = c

for i in range(n):
    g[i][i] = 0

gg = warshall_floyd(g,n)

ans = 0
dist = 0
max_dist = 0
pos = lstr[0]-1

for i in range(1,r):
    dist = gg[pos][lstr[i] - 1]
    max_dist = max(max_dist,dist)
    ans += dist
    pos = lstr[i] - 1

dist = gg[lstr[-1]-1][lstr[0]-1]
ans += dist
max_dist = max(max_dist,dist)

print(ans - max_dist)

### FIXED CODE ###

import itertools
def warshall_floyd(g):
    for k in range(len(g)):
        for i in range(len(g)):
            for j in range(len(g)):
                g[i][j] = min(g[i][j], g[i][k]+g[k][j])
    return g

n,m,r = map(int,input().split())
lst = list(map(int,input().split()))
graph = [[float('inf')]*n for _ in range(n)]
for _ in range(m):
    a,b,c = map(int,input().split())
    graph[a-1][b-1] = c
    graph[b-1][a-1] = c
for i in range(n):
    graph[i][i] = 0
d = warshall_floyd(graph)

res = float('inf')
for l in itertools.permutations(lst):
    cnt = 0
    for i in range(1, len(l)):
        cnt += d[l[i-1]-1][l[i]-1]
    res = min(res, cnt)
print(res)
### BUGGY CODE ###

def prime(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

N = int(input())
a = prime(N)
a.sort()
import copy
b = copy.copy(a)
b = list(set(b))
b.sort()
m = 0
def cnt(c_, used, ans,now):
    m = ans
    for i in range(len(c_)):
        for j in range(1,a.count(b[i])+1-c_[i]):
            if now*b[i]**j > N:
                break
            if used.count(b[i]**j) != 0:
                continue
            c = copy.copy(c_)
            c[i] += j
            m = max(m, cnt(c, used+[b[i]**j], ans+1, now*b[i]**j))
    return m

m = cnt([0]*len(b), [], 0, 1)
print(m)

### FIXED CODE ###

def prime(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

N = int(input())
a = prime(N)
a.sort()
import copy
b = copy.copy(a)
b = list(set(b))
b.sort()

ret = 0
for i in b:
    cnt = 0
    idx=0
    while True:
        idx += 1
        cnt = cnt + idx
        if a.count(i) >= cnt:
            ret += 1
        else:
            break

print(ret)
### BUGGY CODE ###

s=[int(i) for i in input()]
n=len(s)
updated=True
while updated:
    updated=False
    for i in range(len(s)-1):
        if i not in range(len(s)-1):
            break
        while i in range(len(s)-1) and s[i] != s[i+1]:
            del s[i]
            del s[i]
            updated=True

print(n-len(s))


### FIXED CODE ###

s=input()

stack=[]
for si in s:
    stack.append(si)
    if len(stack) >= 2 and stack[-1] != stack[-2]:
        del stack[-1]
        del stack[-1]
print(len(s)-len(stack))
### BUGGY CODE ###

N = int(input())
S = input()

r = 0
g = 0
b = 0
ans = 0
for s in S:
    if s == "R":
        r += 1
    elif s == "G":
        g += 1
    else:
        b += 1

for i in range(len(S)-2):
    if S[i] == "R":
        ans += g * b
        r -= 1
    elif S[i] == "G":
        ans += r * b
        g -= 1
    else:
        ans += r * g
        b -= 1
    
    for j in range(len(S)):
        j += 1
        if i + j >= len(S) or i + j + j >= len(S):
            break
        if S[i] == "R":
            if S[i + j] == "G" and S[i + j + j] == "B" or S[i + j] == "B" and S[i + j + j] == "G":
                ans -= 1
        if S[i] == "G":
            if S[i + j] == "R" and S[i + j + j] == "B" or S[i + j] == "B" and S[i + j + j] == "R":
                ans -= 1
        if S[i] == "B":
            if S[i + j] == "G" and S[i + j + j] == "R" or S[i + j] == "R" and S[i + j + j] == "G":
                ans -= 1

print(ans)


### FIXED CODE ###

from collections import Counter
N = int(input())
S = input()
tmp = Counter(S)
# print(tmp)
r = tmp["R"]
g = tmp["G"]
b = tmp["B"]
ans = 0
# for s in S:
#     if s == "R":
#         r += 1
#     elif s == "G":
#         g += 1
#     else:
#         b += 1

for i in range(len(S) - 2):
    j = 1
    if S[i] == "R":
        ans += g * b
        r -= 1
    elif S[i] == "G":
        ans += r * b
        g -= 1
    else:
        ans += r * g
        b -= 1
    
    while not (i + j + j >= len(S)):
        if S[i] == "R":
            if S[i + j] == "R":
                j += 1
                continue
            if S[i + j] == "G" and S[i + j + j] == "B" or S[i + j] == "B" and S[i + j + j] == "G":
                ans -= 1
        if S[i] == "G":
            if S[i + j] == "G":
                j += 1
                continue
            if S[i + j] == "R" and S[i + j + j] == "B" or S[i + j] == "B" and S[i + j + j] == "R":
                ans -= 1
        if S[i] == "B":
            if S[i + j] == "B":
                j += 1
                continue
            if S[i + j] == "G" and S[i + j + j] == "R" or S[i + j] == "R" and S[i + j + j] == "G":
                ans -= 1
        j += 1
print(ans)
### BUGGY CODE ###

N = int(input())
x = 0
while x == 0:
    num = 2
    while N % 2 != 0:
        num += 1
    if num == N:
        x = 1
    else:
        N += 1
print(N)

### FIXED CODE ###

N = int(input())
x = True
while x:
    num = 2
    while N % num != 0:
        num += 1
    if num == N:
        x = False
    else:
        N += 1
print(N)
### BUGGY CODE ###

def P(s):
  L = [0] * 26
  R = P = 0
  for i in range(D):
    t = I[i + D][0] - 1
    R += I[i][t]
    P += s - (i + 1 - L[t]) * C[t]
    R -= P
    L[t] = i + 1
  return R
(D,), C, *I = [list(map(int, o.split())) for o in open(0)]
for d, q in I[2*D + 1:]:
  I[d - 1 + D][0] = q
  print(P(sum(C)))

### FIXED CODE ###

def P(s):
  L = [0] * 26
  R = P = 0
  for i in range(D):
    t = I[i + D][0] - 1
    R += I[i][t]
    P += s - (i + 1 - L[t]) * C[t]
    R -= P
    L[t] = i + 1
  return R
(D,), C, *I = [list(map(int, o.split())) for o in open(0)]
for d, q in I[2*D + 1:]:
  I[d - 1 + D][0] = q
  print(P(sum(C)))
### BUGGY CODE ###

N, K = map(int, input().split())
 
ans = 0
mod = pow(10,9)+7
 
for k in range(K, N+2): ## K個以上で総数(N+1)
  ## 全個数の計算　## k個最大 ## k個最小
  ans += sum(range(N-k+1, N+1)) - sum(range(0, k)) + 1
  
print(ans % mod)

### FIXED CODE ###

N, K = map(int, input().split())
 
ans = 0
mod = pow(10,9)+7
 
for k in range(K, N+2): ## K個以上で総数(N+1)
  ## 全個数の計算　## k個最大 ## k個最小
  ans += k*((N+1-k)+N)//2 - k*(0+k-1)//2 + 1
  
print(ans % mod)


## sum(range(N-k+1, N+1))
## k*((N+1-k)+N)/2

## sum(range(0, k))
## k*(0+k-1)/2
### BUGGY CODE ###

N = int(input())
S = input()

left = []
right = []
ans = 3*10**5
E = S.count("E")
W = S.count("W")
# print(E)
# print(W)

for i in range(N):
    left_count = 0
    right_count = 0
    left = S[0:i]
#     right = S[i+1:]

    left_count = left.count("W")
    if S[i]== "W":
        right_count = E - (i - left_count)
    else:
        right_count = E - 1 - (i - left_count)

#     print(left_count)
#     print(right_count)
    count = left_count + right_count
    ans = min(count, ans)
print(ans)


### FIXED CODE ###

N = int(input())
S = list(input())

# 一番左がリーダーの時
l = 0
r = S[1:].count('W')
ans = l + r
for i in range(1, N):
    if S[i-1] == 'E':  # 元リーダーの人が東向きの時
        l += 1
    if S[i] == 'W':  # 元リーダーが西向きの時
        r -= 1
    cnt = l+r
    ans = max(cnt, ans)  # 向きを変える必要のない人数
print(N - ans -1)  # 向きを変える必要のある人数
### BUGGY CODE ###

import itertools

N, K, C = list(map(int, input().split()))
S = list(input())

S_OK = [i for i, x in enumerate(S) if x == 'o']
SF, SL = S_OK.copy(), S_OK.copy()
F = []
L = []

for j in range(K):
    F.append(SF[0])
    SF = [i for i in SF if SF[0] + C < i]
    L.insert(0, SL[-1])
    SL = [i for i in SL if SL[-1] - C > i]

[print(i + 1) for i in set(F) & set(L)]

### FIXED CODE ###

# import time

N, K, C = list(map(int, input().split()))
S = list(input())

F = []
L = []

# t1 = time.time()
# for i in range(N):
#     if S[i] == 'o':
#         if len(F) == 0:
#             F.append(i)
#         elif F[-1] + C < i:
#             F.append(i)
#     if len(F) >= K:
#         break
# print(F)
# t2 = time.time()
i = 0
while len(F) <= K and i < N:
    if S[i] == 'o':
        if len(F) == 0:
            F.append(i)
        elif F[-1] + C < i:
            F.append(i)
    i += 1
# print(F)
# t3 = time.time()

# print(t2 - t1, t3 - t2)

i = N - 1
while len(L) <= K and i >= 0:
    if S[i] == 'o':
        if len(L) == 0:
            L.append(i)
        elif L[-1] - C > i:
            L.append(i)
    i -= 1

if len(F) == K and len(L) == K:
    ans = [i + 1 for i in set(F) & set(L)]
    if len(ans) != 0:
        ans.sort()
        [print(i) for i in ans]
### BUGGY CODE ###

n,k=map(int,input().split())
p=list(map(int,input().split()))
idx = 0
s=0
e=0

for i in range(n-k+1):
    s1 = sum(p[i:i+k])
    if s1 > s:
        idx = i
        s = s1

for i in range(idx,idx+k):
    p1 = p[i]
    e1 = (1 + p1)*(p1//2 + 0.5*(p1%2))/p1
    e += e1

print(e)


### FIXED CODE ###

n,k=map(int,input().split())
p=list(map(int,input().split()))
l=[sum(p[:k])]

for i in range(n-k):
    l1=l[i] - p[i] + p[i+k]
    l.append(l1)

print((max(l)+k)/2)
### BUGGY CODE ###

n = int(input())

num = list(input().split())
ans = 1
for i in num:
    ans *= int(i)
    n *= len(i)

if ans > 10**18:
    print('-1')
else: 
    print(ans)



### FIXED CODE ###

n = int(input())

num = list(input().split())
ans = 1
if '0' in num :
    ans = 0
else:
    for i in num:
        ans *= int(i)
        if ans  > 10**18:
            break

if ans > 10**18:
    print('-1')
else: 
    print(ans)
### BUGGY CODE ###

import sys
import heapq

N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
Q = []
for i in range(N):
    heapq.heappush(Q, (-B[i], i))
ans = 0
cnt = 0

while len(Q) != 0:
    _, i = heapq.heappop(Q)

    if (B[i] - A[i]) % (B[(i-1) % N] + B[(i+1) % N]) == 0:
        ans += (B[i] - A[i]) // (B[(i-1) % N] + B[(i+1) % N])
        cnt += 1
        B[i] = A[i]
    else:
        tmp = (B[i] - 1) // (B[(i-1) % N] + B[(i+1) % N])
        B[i] -= tmp * (B[(i-1) % N] + B[(i+1) % N])
        ans += tmp
        if B[i] < A[i]:
            print(-1)
            sys.exit()
        heapq.heappush(Q, (-B[i], i))
    
    if cnt == N:
        print(ans)
        sys.exit()

print(-1)

### FIXED CODE ###

import sys
import heapq

N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
Q = []
for i in range(N):
    heapq.heappush(Q, (-B[i], i))
ans = 0
cnt = 0

while len(Q) != 0:
    _, i = heapq.heappop(Q)

    if (B[i] - A[i]) % (B[(i-1) % N] + B[(i+1) % N]) == 0:
        ans += (B[i] - A[i]) // (B[(i-1) % N] + B[(i+1) % N])
        cnt += 1
        B[i] = A[i]
    else:
        tmp = (B[i] - 1) // (B[(i-1) % N] + B[(i+1) % N])
        
        if tmp == 0:
            print(-1)
            sys.exit()
        
        B[i] -= tmp * (B[(i-1) % N] + B[(i+1) % N])
        ans += tmp
        heapq.heappush(Q, (-B[i], i))
    
    if cnt == N:
        print(ans)
        sys.exit()

print(-1)
### BUGGY CODE ###

n=int(input())
s=input()
ans=0
for i in range(n):
    if i<n-1:
        if s[i]==s[i+1]:
            ans=max(ans,1)
    for j in range(i+2,n):
        if s[i]==s[j] and j-i>1:
            ii=i
            jj=j
            if j<n-1:
                while s[ii+1]==s[jj+1]:
                    ii+=1
                    jj+=1
                    if ii==j-1 or jj==n-1:
                        break
                ans=max(ans,ii-i+1)
print(ans)

### FIXED CODE ###

n=int(input())
s=input()
l=0
r=n//2
while r-l>=1:
    m=(r+l+1)//2
    d={}
    flg=False
    for i in range(n-m+1):
        t=s[i:i+m]
        if t in d:
            if d[t]+m-1<i:
                flg=True
                break
        else:
            d[t]=i
    if flg:
        l=m
    else:
        r=m-1
print(l)
### BUGGY CODE ###

n , k = map(int , input().split())
arr = list(map(int , input().split()))
tot=1
for i in range(0 , k):
	tot = tot*arr[i]
j = 0
for i in range(k , n):
	now = tot*arr[i]
	now = now//arr[j]
	j=j+1
	if now>tot:
		print("Yes")
	else:
		print("No")


### FIXED CODE ###

import math
n , k = map(int , input().split())
arr = list(map(int , input().split()))
tot=0
for i in range(0 , k):
	tot = tot + (math.log2(arr[i]))
j = 0
for i in range(k , n):
	now = tot + math.log2(arr[i])
	now = now-math.log2(arr[j])
	j=j+1
	if now>tot:
		print("Yes")
	else:
		print("No")
### BUGGY CODE ###

import numpy as np
N, K, Q = map(int, input().split(" "))

score_list = np.ones(N) * K

for q in range(Q):
    i = int(input())

    subtract = np.ones(N) * -1
    subtract[i - 1] += 1

    score_list = score_list + subtract

for s in score_list:
    if s > 0:
        print("Yes")
    else:
        print("No")

### FIXED CODE ###

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

score_list = [K - Q] * N

for q in range(Q):
    i = int(input())
    score_list[i - 1] += 1

for s in score_list:
    if s > 0:
        print("Yes")
    else:
        print("No")