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

#素因数分解（10**6まで）
def soinsu_bunkai(m):
    pf=set()
    mm =m
    for i in pri_num:
        while mm %i==0:
            if i >m:
                break
            elif mm %i==0:
                pf.add(i)
                mm //=i
    if mm !=1:
        pf.add(mm)
    return pf

    # 初期入力
import math
import sys
from collections import Counter
from functools import reduce
input = sys.stdin.readline  #文字列では使わない
N = int(input())
A = list(map(int, input().split()))
intersect =set()
pair_w =set()

# 10**6までの素因数分解するために、「10**6のルート」までの素数を列挙
pri =10**6 +10
sq_pri =int(math.sqrt(pri))
#pri_num =prime_numbers(sq_pri +10 )
pri_num =[2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997, 1009]

#not coprimeの判定
gcd_a =reduce(math.gcd,A)
if gcd_a !=1:
    ans ="not coprime"

#pairwise coprimeの判定
else:
    for a in A:
        aa =soinsu_bunkai(a)
        if intersect & aa:
            pair_w.add(0)
            break #共通要素があったらpair_wではない→set_w
        else:
            pair_w.add(1)
        intersect |=aa

    if 0 in pair_w:
        ans ="setwise coprime"        
    else:
        ans ="pairwise coprime"
print(ans)

### FIXED CODE ###

#高速素因数分解  osa_k法 
def osa_k(a):
    tmp = set()
    while a > 1:
        tmp.add(sieve[a])
        a //= sieve[a]
    return tmp

    # 初期入力
import math
import sys
from bisect import bisect_left
from functools import reduce
input = sys.stdin.readline  #文字列では使わない
N = int(input())
A = list(map(int, input().split()))
used =set()

#not coprimeの判定
gcd_a =reduce(math.gcd,A)
if gcd_a !=1:
    ans ="not coprime"

#pairwise coprimeの判定
else:
    MAXN =10**6 +10
    #osa_k法
    sieve = [i for i in range(MAXN+1)]
    p = 2
    while p*p <= MAXN:
        if sieve[p] == p:
            for q in range(2*p,MAXN+1,p):
                if sieve[q] == q:
                    sieve[q] = p
        p += 1
    
    ans ="pairwise coprime"
    for a in A:
        aa =osa_k(a)
        if used & aa:
            ans ="setwise coprime"
            break #共通要素があったらpair_wではない→set_w
        used |=aa
    
print(ans)
### BUGGY CODE ###

import sys,fractions
sys.setrecursionlimit(10**5)
def input():
    return sys.stdin.readline()[:-1]

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

u = 10**9+7

from functools import reduce

def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)

def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

G = l[0]
for i in range(N-1,0,-1):
    G = fractions.gcd(G,l[i])
    if G==1:
        break

gcd = G
L = [l[i]//gcd for i in range(N)]
lcm = lcm_list(L)

# print(lcm,gcd,'aaa')
ANS = 0
b = [lcm//L[i] for i in range(N)]
print(sum(b)%(u))

### FIXED CODE ###

import sys
from fractions import gcd
sys.setrecursionlimit(10**5)
def input():
    return sys.stdin.readline()[:-1]

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

u = 10**9+7

lcm = 1
s = 0
for i in range(N):
    k = l[i]
    g = gcd(k,lcm)
    t = k//g
    lcm = lcm*t
    s = s*t + lcm//k
print(s%u)
### BUGGY CODE ###

import heapq
n,m=map(int,input().split())
a=list(map(int,input().split()))
heapq.heapify(a)
for i in range(m):
	b,c=map(int,input().split())
	for j in range(b):
		if a[0]<c:
			heapq.heappop(a)
			heapq.heappush(a,c)
print(sum(a))

### FIXED CODE ###

# 2019/07/20

from heapq import heappop,heappush,heapify

n,m=map(int,input().split())
a=list(map(int,input().split()))
heapify(a)
bc=[]
for i in range(m):
    b,c=map(int,input().split())
    hq=(-c,b)
    heappush(bc,hq)



def cg(res):

    while bc:
        c,b=heappop(bc)
        c=-c
        while b and a:
            b-=1
            v=heappop(a)
            if c>v:res+=c
            else:
                res+=v
                return res
    return res
res=0
res=cg(res)
print(sum(a)+res)
### BUGGY CODE ###

from bisect import bisect_left
def main():
    n = int(input())
    s = input().rstrip()
    q = int(input())
    ans = []
    al = [[] for _ in range(26)]
    for i in range(n):
        al[ord(s[i]) - ord("a")].append(i)
    for _ in range(q):
        x, y, z = map(str, input().rstrip().split())
        if x == "1":
            y = int(y)
            y -= 1
            if s[y] == z:
                continue
            al[ord(z) - ord("a")].insert(bisect_left(al[ord(z) - ord("a")], y), y)
            al[ord(s[y]) - ord("a")].remove(y)
            s = s[:y] + z + s[y+1:]
        else:
            y = int(y)
            y -= 1
            z = int(z)
            cnt = 0
            for i in range(26):
                index = bisect_left(al[i], y)
                if index < len(al[i]) and al[i][index] < z:
                    cnt += 1
            ans.append(cnt)
    for v in ans:
        print(v)

if __name__ == "__main__":
    main()

### FIXED CODE ###

from bisect import bisect_left, insort
def main():
    n = int(input())
    s = list(input().rstrip())
    q = int(input())
    ans = []
    al = [[] for _ in range(26)]
    for i, c in enumerate(s):
        al[ord(c) - ord("a")].append(i)
    for _ in range(q):
        x, y, z = map(str, input().rstrip().split())
        if x == "1":
            y = int(y) - 1
            if s[y] == z:
                continue
            p = bisect_left(al[ord(s[y])-ord("a")],y)
            al[ord(s[y])-ord("a")].pop(p)
            insort(al[ord(z)-ord("a")],y)
            s[y] = z
        else:
            y = int(y) - 1
            z = int(z)
            cnt = 0
            for i in range(26):
                index = bisect_left(al[i], y)
                if index < len(al[i]) and al[i][index] < z:
                    cnt += 1
            ans.append(cnt)
    for v in ans:
        print(v)

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

import sys
import numpy as np
import numba
from numba import jit
 
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

@jit
def main(p):
  count = 0
  if np.any(p%2==1):
    return 0
  if np.unique(p).size == 1:
    return -1
  while True:
    if np.any(p%2 == 1):
      return count
    p[0], p[1], p[2] = p[1]/2 + p[2]/2, p[0]/2 + p[2]/2, p[0]/2 + p[1]/2
    count += 1


p = np.array(readline().split(), np.int64)

print(main(p))

### FIXED CODE ###

a, b, c = map(int, input().split())
if a == b and b == c:
    if a % 2 == 0:
        print(-1)
    else:
        print(0)
else:
    count = 0
    while a % 2 == 0 and b % 2 == 0 and c % 2 == 0:
        a, b, c = (b + c) // 2, (c + a) // 2, (a + b) // 2
        count += 1
    print(count)
### BUGGY CODE ###

import numpy as np

N = int(input())
inputs = np.array(input().split(), dtype=np.uint8)
inputs = inputs[::-1]
boxes = np.zeros_like(inputs)
M = 0
outputs = []

for i, a in enumerate(inputs):
    num = N - i
    if num > N / 2:
        if a == 1:
            M += 1
            outputs.append(num)
            boxes[num-1] = 1
    else:
        idxs = np.arange(num,  N+1, num) - 1
        S = boxes[idxs].sum()
        if S % 2 != a:
            M += 1
            outputs.append(num)
            boxes[num-1] = 1
        # print(num, idxs+1, S, boxes)

print(M)
if M != 0:
    outputs.sort()
    outputs = [str(x) for x in outputs]
    print(' '.join(outputs))

### FIXED CODE ###

import sys
import math  # noqa
import bisect  # noqa
import queue  # noqa


def input():
    return sys.stdin.readline().rstrip()


if __name__ == '__main__':
    N = int(input())
    A = list(map(int, input().split()))

    B = [0 for _ in range(N)]
    for i in range(N - 1, N // 2 - 1, -1):
        B[i] = A[i]
    for i in range(N // 2 - 1, -1, -1):
        res = 0
        for j in range(i, N, i + 1):
            res += B[j]
        if res % 2 == 0 and A[i] == 1:
            B[i] = 1
        elif res % 2 != 0 and A[i] == 0:
            B[i] = 1

    cnt = 0
    for b in B:
        if b == 1:
            cnt += 1
    print(cnt)
    if cnt > 0:
        res = [i + 1 for i, b in enumerate(B) if b != 0]
        print(*res)
### BUGGY CODE ###

N = int(input())

MOD = 10**9+7
fac = [1,1] + [0]*N
finv = [1,1] + [0]*N
inv = [0,1] + [0]*N
for i in range(2,N+2):
    fac[i] = fac[i-1] * i % MOD
    inv[i] = -inv[MOD%i] * (MOD // i) % MOD
    finv[i] = finv[i-1] * inv[i] % MOD

def ncr(n,r):
    if n < r: return 0
    if n < 0 or r < 0: return 0
    return fac[n] * (finv[r] * finv[n-r] % MOD) % MOD

ans = 0
prev = 0
for k in range((N+1)//2, N):
    tmp = ncr(k-1, N-1-k) * fac[k] * fac[N-1-k]
    tmp %= MOD
    ans += (tmp - prev) * k
    ans %= MOD
    prev = tmp
print(ans)

### FIXED CODE ###

N = int(input())

MOD = 10**9+7
fac = [1,1] + [0]*N
finv = [1,1] + [0]*N
inv = [0,1] + [0]*N
for i in range(2,N+2):
    fac[i] = fac[i-1] * i % MOD
    inv[i] = -inv[MOD%i] * (MOD // i) % MOD
    finv[i] = finv[i-1] * inv[i] % MOD

def ncr(n,r):
    if n < r: return 0
    if n < 0 or r < 0: return 0
    return fac[n] * (finv[r] * finv[n-r] % MOD) % MOD

ans = 0
prev = 0
for k in range((N+1)//2, N):
    tmp = ncr(k-1, N-1-k) * fac[k] * fac[N-1-k]
    tmp %= MOD
    ans += (tmp - prev) * k
    ans %= MOD
    prev = tmp
print(ans)
### BUGGY CODE ###

N, K = map(int, input().split())
p = list(map(int, input().split()))
ans = 0
for i in range(N-K+1):
    kitaichi = 0
    for j in range(i, i+K):
        kitaichi += (p[j]+1)/2
    ans = max(ans, kitaichi)
print("{:.20f}".format(ans))


### FIXED CODE ###

N, K = map(int, input().split())
p = list(map(int, input().split()))
S = [0]
for i in range(N):
    S.append(S[i] + (p[i]+1)/2)
ans = 0
for i in range(N-K+1):
    tmp = S[i+K] - S[i]
    ans = max(ans, tmp)
print('{:.20f}'.format(ans))
### BUGGY CODE ###

import math


def is_exist_b(search_list, target):
    low = 0
    high = len(search_list)
    if high == 0:
        return False
    index = (low + high) // 2
    while low <= high:
        if target == search_list[index]:
            break
        elif i > search_list[index]:
            low = index + 1
        elif i < search_list[index]:
            high = index - 1
        index = (low + high) // 2
    if target == search_list[index]:
        return True
    else:
        return False


def make_list(base, ceil):
    limit = ceil + base
    max_t = int(math.log2(limit))
    result = []
    for t in range(1, max_t + 1):
        can = 2**t - base
        if 0 < can <= ceil:
            result.append(can)
    return result


n = int(input())

nums = list(map(int, input().split()))
nums = sorted(nums)

combs = []
for i in range(n):
    for num in make_list(nums[i], nums[n - 1]):
        if is_exist_b(nums[i + 1:], num):
            combs.append((nums[i], num))

answer = 0
for i in range(len(combs)):
    existence = []
    for a, b in combs[i:]:
        if not (a in existence or b in existence):
            existence.append(a)
            existence.append(b)
    size = len(existence) // 2
    if size > answer:
        answer = size

print(answer)


### FIXED CODE ###

from collections import Counter

n = int(input())
nums = sorted(list(map(int, input().split())), reverse=True)

num_map = Counter(nums)

answer = 0
for num in nums:
    pair = (1 << (num.bit_length())) - num

    if num_map[num] > 0 and num_map[pair]:
        if num == pair and num_map[num] > 1:
            answer += 1
            num_map[num] -= 2
        if num > pair:
            answer += 1
            num_map[num] -= 1
            num_map[pair] -= 1

print(answer)
### BUGGY CODE ###

n,m=map(int,input().split())
danger=[int(input()) for i in range(m)]

if 1 in danger:
    steps=[1,0]
else:
    steps=[1,1]

for this_step in range(2,n+1):
    if this_step in danger:
        ap=0
    else:
        ap=steps[-1]+steps[-2]
    steps.append(ap)

print(steps[-1]%1000000007)

### FIXED CODE ###

n,m = map(int,input().split())
a = [int(input()) for _ in range(m)]
a = set(a)
mod = 10**9+7
dp = [0]*(n+1)
dp[0] = 1
if 1 not in a:
    dp[1] = 1
for i in range(2,n+1):
    if i not in a:
        dp[i] = dp[i-1]+dp[i-2]
print(dp[-1]%mod)
### BUGGY CODE ###

import queue

N = int(input())
E = {n: set() for n in range(N)}
C = {}

for _ in range(N - 1):
    a, b, c = map(int, input().split())
    a -= 1
    b -= 1
    E[a].add(b)
    E[b].add(a)
    C[(min(a, b), max(a, b))] = c 

Q, K = map(int, input().split())
K -= 1
dist = [-1] * N
already = set()
que = queue.Queue()
que.put((K, 0))
while not que.empty():
    now, c = que.get()
    already.add(now)
    dist[now] = c
    out = E[now]
    for n in out:
        if n in already:
            continue
        que.put((n, c + C[min(now, n), max(now, n)]))

for _ in range(Q):
    x, y = map(int, input().split())
    x -= 1
    y -= 1
    print(dist[x] + dist[y])


### FIXED CODE ###

import queue

N = int(input())
E = {n: set() for n in range(N)}

for _ in range(N - 1):
    a, b, c = map(int, input().split())
    a -= 1
    b -= 1
    E[a].add((b, c))
    E[b].add((a, c))

Q, K = map(int, input().split())
K -= 1
dist = [-1] * N
already = set()
que = queue.Queue()
que.put((K, 0))
while not que.empty():
    now, d = que.get()
    already.add(now)
    dist[now] = d
    out = E[now]
    for n, c in out:
        if n in already:
            continue
        que.put((n, d + c))

for _ in range(Q):
    x, y = map(int, input().split())
    x -= 1
    y -= 1
    print(dist[x] + dist[y])
### BUGGY CODE ###

# -*- coding: utf-8 -*-
from __future__ import print_function

n = int(raw_input())
li = map(int, raw_input().split())


for i in xrange(1,n+1):
    print(str(li.index(i) + 1) + " ", end="")


### FIXED CODE ###

# coding: utf-8
n = int(raw_input())
li = map(int, raw_input().split())

listb = []
listb = sorted(range(len(li)), key=lambda k: li[k])

s = str(map(lambda x: x+1, listb))

print s.replace("[","").replace("]","").replace(",","")
### BUGGY CODE ###

n, k = map(int, input().split())
a_l = list(map(int, input().split()))
           
import sys
def g():
    m_l = [0] * (n+1)

    r = 0
    for a in a_l:
        if m_l[a] == 0: r += 1
        m_l[a] += 1

    if r <= k:
        print(0)
        sys.exit(0)

    mn = 0
    
    while True:
        mm = min(i for i in m_l if i > 0)

        for i in range(n+1):
            if mm == m_l[i]:
                mn += mm
                r -= 1
                m_l[i] = 0

                if r <= k: return mn
        
print(g())


### FIXED CODE ###

n, k = map(int, input().split())
a_l = list(map(int, input().split()))
           
import sys
import numpy as np

def g():
    m_l = np.array([0]*(n+1))

    r = 0
    for a in a_l:
        if m_l[a] == 0: r += 1
        m_l[a] += 1

    if r <= k:
        print(0)
        sys.exit(0)

    mn = 0
    while True:
        ma = np.ma.masked_equal(m_l, 0, copy=False)
        a = np.where(m_l == ma.min())[0]

        for i in a:
            mn += m_l[i]
            r -= 1
            m_l[i] = 0

            if r <= k: return mn
        
print(g())
### BUGGY CODE ###

import sys
from math import ceil as C, floor as F, sqrt, gcd as G
from collections import defaultdict as D, Counter as CNT
from functools import reduce as R
import heapq as HQ
from operator import mul

class Heap:
  def __init__(self, data, reverse=False):
    self.reverse = -1 if reverse else 1
    self.data = [self.reverse * d for d in data]
    HQ.heapify(self.data)
  def push(self, x): return HQ.heappush(self.data, self.reverse * x)
  def pop(self): return self.reverse * HQ.heappop(self.data) 

ALP = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
alp = 'abcdefghijklmnopqrstuvwxyz'
def prod(list): return R(mul, list, 1)
def _X(): return sys.stdin.readline().rstrip().split(' ')
def _S(ss): return tuple(ss) if len(ss) > 1 else ss[0]
def S(): return _S(_X())
def Ss(): return list(S())
def _I(ss): return tuple([int(s) for s in ss]) if isinstance(ss, tuple) else int(ss)
def I(): return _I(S())
def _Is(ss): return list(ss) if isinstance(ss, tuple) else [ss]
def Is(): return _Is(I())

n = I()
rgb = S()

cnt = CNT(list(rgb))
ans = prod([cnt[c] for c in ['R', 'G', 'B']])

for i, r in enumerate(rgb):
    for j, g in enumerate(rgb[i+1:], start=i+1):
        k = j + (j - i)
        if k < len(rgb):
            if r != g and g != rgb[k] and r != rgb[k]:
                ans -= 1

print(ans)
        


### FIXED CODE ###

import sys
from math import ceil as C, floor as F, sqrt, gcd as G
from collections import defaultdict as D, Counter as CNT
from functools import reduce as R
import heapq as HQ
from operator import mul

class Heap:
  def __init__(self, data, reverse=False):
    self.reverse = -1 if reverse else 1
    self.data = [self.reverse * d for d in data]
    HQ.heapify(self.data)
  def push(self, x): return HQ.heappush(self.data, self.reverse * x)
  def pop(self): return self.reverse * HQ.heappop(self.data) 

ALP = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
alp = 'abcdefghijklmnopqrstuvwxyz'
def prod(list): return R(mul, list, 1)
def _X(): return sys.stdin.readline().rstrip().split(' ')
def _S(ss): return tuple(ss) if len(ss) > 1 else ss[0]
def S(): return _S(_X())
def Ss(): return list(S())
def _I(ss): return tuple([int(s) for s in ss]) if isinstance(ss, tuple) else int(ss)
def I(): return _I(S())
def _Is(ss): return list(ss) if isinstance(ss, tuple) else [ss]
def Is(): return _Is(I())

n = I()
rgb = S()

cnt = CNT(list(rgb))
ans = prod([cnt[c] for c in ['R', 'G', 'B']])

for i, r in enumerate(rgb):
    for j, g in enumerate(rgb[i+1:], start=i+1):
        k = j + (j - i)
        if k < len(rgb):
            if r != g and g != rgb[k] and r != rgb[k]:
                ans -= 1

print(ans)
### BUGGY CODE ###

from numpy import*;a,b=loadtxt(open(0),skiprows=1);c=0;l=2**29
while l:h=l;l//=2;i,j=searchsorted(sort(hstack((b%h-h,b%h))),[l-a%h,h-a%h]);c+=sum(j-i)%2*l
print(c)

### FIXED CODE ###

from numpy import*;B,I=searchsorted,lambda:int32(input().split());input();a,b=I(),I();c=0
for k in range(29):l=2**k;h=l*2;x,y=a%h,sort(b%h);y=hstack((y-h,y));c+=sum(B(y,h-x)-B(y,l-x))%2*l
print(c)
### BUGGY CODE ###

class WeightsUnionfind:
  def __init__(self,n):
    self.Tree=[i for i in range(n)]
    self.dWeights=[0]*n
    self.wrong=0

  def find(self,x):
    if x==self.Tree[x]:
      return x
    else:
      root=self.find(self.Tree[x])
      self.dWeights[x]=self.weigh(x)
      self.Tree[x]=root
      return root
  
  def weigh(self,x):
    if x==self.Tree[x]:
      return 0
    else:
      w=self.weigh(self.Tree[x])+self.dWeights[x]
      return w

  def unite(self,x,y,w):
    s1=self.find(x)
    s2=self.find(y)
    if s1==s2:
      if self.weigh(y)-self.weigh(x)!=w:
        self.wrong=1
    else:
      self.Tree[s1]=s2
      self.dWeights[s1]=self.weigh(y)-self.weigh(x)-w
      
N,M=map(int,input().split())
wuf=WeightsUnionfind(N)
F=0
for m in range(M):
  l,r,d=map(int,input().split())
  wuf.unite(l-1,r-1,d)
if wuf.wrong==1:
  print("No")
else:
  print("Yes")
    

  
      
    
      
      

### FIXED CODE ###

class WeightsUnionfind:
  def __init__(self,n):
    self.Tree=[i for i in range(n)]
    self.dWeights=[0]*n
    self.rank=[0]*n
    self.wrong=0

  def find(self,x):
    if x==self.Tree[x]:
      return x
    else:
      root=self.find(self.Tree[x])
      self.dWeights[x]=self.weigh(x)
      self.Tree[x]=root
      return root
  
  def weigh(self,x):
    if x==self.Tree[x]:
      return 0
    else:
      w=self.weigh(self.Tree[x])+self.dWeights[x]
      return w

  def unite(self,x,y,w):
    s1=self.find(x)
    s2=self.find(y)
    if s1==s2:
      if self.weigh(y)-self.weigh(x)!=w:
        self.wrong=1
    else:
      if self.rank[s1]>self.rank[s2]:
        self.Tree[s2]=s1
        self.dWeights[s2]=self.weigh(x)-self.weigh(y)+w
      elif self.rank[s1]<self.rank[s2]:
        self.Tree[s1]=s2
        self.dWeights[s1]=self.weigh(y)-self.weigh(x)-w
      else:
        self.Tree[s2]=s1
        self.rank[s1]+=1
        self.dWeights[s2]=self.weigh(x)-self.weigh(y)+w
          
N,M=map(int,input().split())
wuf=WeightsUnionfind(N)
F=0
for m in range(M):
  l,r,d=map(int,input().split())
  wuf.unite(l-1,r-1,d)
if wuf.wrong==1:
  print("No")
else:
  print("Yes")
### BUGGY CODE ###

N,K,Q = map(int,input().split())
a = [K]*N
for i in range(Q):
    a=[i-1 for i in a]
    a[int(input())-1]+=1
for i in range(N):
    if a[i]>0:
        print('Yes')
    else:
        print('No')

### FIXED CODE ###

N,K,Q = map(int,input().split())
a = [K]*N

for i in range(Q):
    a[int(input())-1]+=1
a=list(map(lambda x: x-Q, a))
for i in range(N):
    if a[i]>0:
        print('Yes')
    else:
        print('No')
### BUGGY CODE ###

import bisect

n = int(input())
s = list(map(int, input().split(" ")))
# n = 18
# s = list(reversed(range(1, 2 ** n + 1)))

s = sorted(s)
from collections import deque

def solve():
    global s

    parents = [s[-1]]
    s.pop()

    for i in range(n):
        newparents = list(parents)
        k = len(s)
        dropped = set()
        # print(parents)
        for p in parents:
            oldK = k
            k = bisect.bisect(s[:k], p - 1) - 1
            # print("Old", oldK, k, s[k], p)
            if k == -1:
                print("No")
                exit(0)

            newparents.append(s[k])
            dropped.add(k)
        s = [x for i, x in enumerate(s) if i not in dropped]

        parents = sorted(newparents, reverse=True)

    # print(parents)
    # print(k)
    if k == len(s):
        print("Yes")
    else:
        print("No")
solve()


### FIXED CODE ###

import bisect

n = int(input())
s = list(map(int, input().split(" ")))
# n = 18
# s = list(reversed(range(1, 2 ** n + 1)))

s = sorted(s)
from collections import deque

def solve():
    global s

    parents = [s[-1]]
    s.pop()

    for i in range(n):
        newparents = list(parents)
        k = len(s)
        dropped = set()
        # print(parents)
        for p in parents:
            oldK = k
            k = bisect.bisect(s, p - 1, 0, k) - 1
            # print("Old", oldK, k, s[k], p)
            if k == -1:
                print("No")
                exit(0)

            newparents.append(s[k])
            dropped.add(k)
        s = [x for i, x in enumerate(s) if i not in dropped]
        parents = sorted(newparents, reverse=True)

    # print(parents)
    # print(k)
    if k == len(s):
        print("Yes")
    else:
        print("No")
solve()