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

n, s = map(int, input().split())
a = list(map(int, input().split()))
a.sort()
mod = 998244353
ans = 0

a_cum = [0 for _ in range(n+1)]
for i in range(n):
    a_cum[i+1] = a_cum[i] + a[i]
#print(a_cum)
dp = [[{} for _ in range(n+1)] for _ in range(n+1)]
dp[0][0] = {0: 1}

for i in range(n):
    for j in range(i+1):
        for k in dp[i][j].keys():
            if k in dp[i+1][j]:
                dp[i+1][j][k] += dp[i][j][k]
            else:
                dp[i+1][j][k] = dp[i][j][k]

            if k + a[i] <= s:
                if k+a[i] in dp[i+1][j+1]:
                    dp[i+1][j+1][k+a[i]] += dp[i][j][k]
                else:
                    dp[i+1][j+1][k+a[i]] = dp[i][j][k]


for j in range(n+1):
    if s in dp[n][j]:
        ans = (ans + dp[n][j][s] * pow(2, n-j, mod) % mod) % mod

print(ans)

### FIXED CODE ###

n, s = map(int, input().split())
a = list(map(int, input().split()))
mod = 998244353
ans = 0

inv_2 = pow(2, mod-2, mod)
dp = [[0 for _ in range(s+1)] for _ in range(n+1)]
dp[0][0] = pow(2, n, mod)

for i in range(n):
    for j in range(s+1):
        dp[i+1][j] += dp[i][j]
        dp[i+1][j] %= mod

        if j + a[i] <= s:
            dp[i+1][j+a[i]] += dp[i][j] * inv_2
            dp[i+1][j+a[i]] %= mod

#print(dp)
print(dp[n][s])
### BUGGY CODE ###

from collections import defaultdict

n,m=map(int,input().split())
s=[tuple(map(int,input().split())) for _ in range(m)]
d=defaultdict(int)
for x in s:
  d[x[0]]|=(1<<x[1])
  d[x[1]]|=(1<<x[0])
if d[1]&d[n]>0:
  print('POSSIBLE')
else:
  print('IMPOSSIBLE')


### FIXED CODE ###

import sys
from collections import defaultdict
from heapq import heapify, heappush
n,m=map(int,input().split())
s=[tuple(map(int,input().split())) for _ in range(m)]
def hl():
  ret=[]
  heapify(ret)
  return ret
d=defaultdict(hl)
for x in s:
  heappush(d[x[0]],-x[1])
  heappush(d[x[1]],-x[0])
for e in d[1]:
  if d[-e][0]==-n:
    print('POSSIBLE')
    sys.exit()
print('IMPOSSIBLE')
### BUGGY CODE ###

from collections import Counter, deque
n = int(input())
S = [input() for _ in range(n)]

dictionary = dict(Counter(S))
ans = [""] * n
i = 0
for k in dictionary.keys():
    if dictionary[k] == max(list(dictionary.values())):
        ans[i] = k
        i += 1

ans.sort()
for a in ans:
    if a == "":
        continue
    print(a)

### FIXED CODE ###

from collections import Counter
n = int(input())
S = [input() for _ in range(n)]

poll = Counter(S)
max_c = max(list(poll.values()))
ans = [k for k in poll.keys() if poll[k] == max_c]
ans.sort()
for a in ans:
     print(a)
### BUGGY CODE ###

import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

S = input()
dp = [[0]*13 for _ in range(len(S)+1)]
dp[0][0] = 1

# for i in range(len(S)):
# 	if S[i] == '?':
# 		c = -1
# 	else:
# 		c = int(S[i])

# 	for j in range(10):  # ? が j のとき考える
# 		if c != -1 and c != j:
# 			continue
# 		for k in range(13):
# 			dp[i+1][(k*10+j)%13] = (dp[i+1][(k*10+j)%13] + dp[i][k]) % mod
S = S[::-1]
for i in range(len(S)):
	mul = 10**i
	mul %= 13
	if S[i] == '?':
		for k in range(10):  # ? が k のとき考える
			for j in range(13):
				dp[i+1][(k*mul+j)%13] = (dp[i+1][(k*mul+j)%13] + dp[i][j]) % mod
	else:
		k = int(S[i])
		for j in range(13):
				dp[i+1][(k*mul+j)%13] = (dp[i+1][(k*mul+j)%13] + dp[i][j]) % mod

# print(dp)
print(dp[len(S)][5])


### FIXED CODE ###

import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

S = input()
dp = [[0]*13 for _ in range(len(S)+1)]
dp[0][0] = 1

for i in range(len(S)):
	if S[i] == '?':
		c = -1
	else:
		c = int(S[i])

	for j in range(10):
		if c != -1 and c != j:
			continue
		for k in range(13):
			dp[i+1][(k*10+j)%13] = (dp[i+1][(k*10+j)%13] + dp[i][k]) % mod

# print(dp)
print(dp[len(S)][5])
### BUGGY CODE ###

import sys

n, m = map(int, input().split())
nums = []

for i in range(n):
    nums.append(i + 1)

for i in range(m):
    l, r = map(int, input().split())
    nums = list(filter(lambda x: l <= x <= r, nums))
    if len(nums) == 0:
        print(0)
        sys.exit()

print(len(nums))




### FIXED CODE ###

n, m = map(int, input().split())
lr = []

for i in range(m):
    lr.append(list(map(int, input().split())))

lmax = 0
mmin = 10**5

for i in range(m):
    lmax = max(lmax, lr[i][0])
    mmin = min(mmin, lr[i][1])

print(max(0, mmin - lmax + 1))
### BUGGY CODE ###

import itertools,sys
for a in sys.stdin:
  c=0
  n,s=map(int,a.split())
  for e in itertools.permutations(range(9),n):
    x=sum([(i+1)*e[i] for i in range(len(e))])
    if x==s: c+=1
  print c

### FIXED CODE ###

import sys
K=1024
N=331
R=range(K)
B=[1,2,4,8,16,32,64,128,256,512]
C=[0]*K
D=[[0 for i in range(N)]for j in R]

for i in R:
  s=format(i,'b')
  n=s.count('1')
  C[i]=n
  if n==1:D[i][B.index(i)]=1
  else:
    for j in range(len(s)):
      if s[-j-1]=='1':
        dp=n*j
        i2=i-B[j]
        for k in range(N-dp):
          D[i][k+dp]+=D[i2][k]
   
for a in sys.stdin:
  n,s=map(int,a.split())
  x=0
  if s<N:x=sum([D[i][s] for i in R if C[i]==n])
  print x
### BUGGY CODE ###

import sys
input = sys.stdin.readline

n, m = [int(x) for x in input().split()]
ab = [[int(x) for x in input().split()] for _ in range(m)][::-1]

#Union Find

#xの根を求める
def find(x):
    if par[x] < 0:
        return x
    else:
        par[x] = find(par[x])
        return par[x]
#xとyの属する集合の併合
def unite(x,y):
    x = find(x)
    y = find(y)

    if x == y:
        return False
    else:
        #sizeの大きいほうがx
        if par[x] > par[y]:
            x,y = y,x
        par[x] += par[y]
        par[y] = x
        return True

#xとyが同じ集合に属するかの判定
def same(x,y):
    return find(x) == find(y)

#xが属する集合の個数
def size(x):
    return -par[find(x)]

#初期化
#根なら-size,子なら親の頂点
par = [-1]*n

from math import factorial

def cmb(n, k):
    return factorial(n) // (factorial(k) * factorial(n - k))
convinience = [0]

for i in ab:
    a, b = i
    res = convinience[-1]
    a -= 1
    b -= 1
    if find(a) == find(b):
        convinience.append(res)
        continue
    if size(a) > 1:
        res -= cmb(size(a), 2)
    if size(b) > 1:
        res -= cmb(size(b), 2)
    unite(a, b)
    res += cmb(size(a), 2)
    convinience.append(res)

convinience = convinience[1::][::-1] + [0]

ans = [0]
for i in range(m):
    ans.append(convinience[i] - convinience[i + 1] + ans[-1])
for i in ans[1:]:
    print(i)

### FIXED CODE ###

import sys
input = sys.stdin.readline

n, m = [int(x) for x in input().split()]
ab = [[int(x) for x in input().split()] for _ in range(m)][::-1]

#Union Find

#xの根を求める
def find(x):
    if par[x] < 0:
        return x
    else:
        par[x] = find(par[x])
        return par[x]
#xとyの属する集合の併合
def unite(x,y):
    x = find(x)
    y = find(y)

    if x == y:
        return False
    else:
        #sizeの大きいほうがx
        if par[x] > par[y]:
            x,y = y,x
        par[x] += par[y]
        par[y] = x
        return True

#xとyが同じ集合に属するかの判定
def same(x,y):
    return find(x) == find(y)

#xが属する集合の個数
def size(x):
    return -par[find(x)]

#初期化
#根なら-size,子なら親の頂点
par = [-1]*n

def cmb(n, k):
    return n * (n - 1) // 2
convinience = [0]

for i in ab:
    a, b = i
    res = convinience[-1]
    a -= 1
    b -= 1
    if find(a) == find(b):
        convinience.append(res)
        continue
    if size(a) > 1:
        res -= cmb(size(a), 2)
    if size(b) > 1:
        res -= cmb(size(b), 2)
    unite(a, b)
    res += cmb(size(a), 2)
    convinience.append(res)

convinience = convinience[1::][::-1] + [0]

ans = [0]
for i in range(m):
    ans.append(convinience[i] - convinience[i + 1] + ans[-1])
for i in ans[1:]:
    print(i)
### BUGGY CODE ###

s = input()
K = int(input())

sub_s = []
for i in range(len(s)):
    for j in range(i+1, len(s)+1):
        if s[i:j] not in sub_s:
            sub_s.append(s[i:j])

sub_s = sorted(sub_s)        
#print(sub_s)
print(sub_s[K-1])

### FIXED CODE ###

s = input()
K = int(input())
 
sub_s = []
for i in range(1, K+1):
    for j in range(len(s) - i + 1):
        sub_s.append(s[j:j+i])
 
sub_s = sorted(list(set(sub_s)))        
#print(sub_s)
print(sub_s[K-1])
### BUGGY CODE ###

import sys

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

def main():
    K = int(input())
    S = input()

    mod = 10 ** 9 + 7
    n = len(S)
    ans = 0

    def nCr(n,r):
        if n - r > r:
            return nCr(n,n-r)
        else:
            a = b = 1
            for i in range(r):
                a = (a * (n - i)) % mod
                b = (b * (r - i)) % mod
            return (a * pow(b,mod-2,mod)) % mod

    for i in range(K+1):
        ans += ((25 ** i * nCr(i+n-1,n-1)) * (26 ** (K - i))) % mod
    print(ans)

if __name__ == "__main__":
    main()

### FIXED CODE ###

import sys

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

def main():
    K = int(input())
    S = input()

    mod = 10 ** 9 + 7
    n = len(S)
    ans = 0

    fact =[1]*(K+n)
    factinv = [1]*(K+n)
    inv = [0,1]


    for i in range(2,K+n):
        fact[i] = (fact[i-1] * i) % mod
        inv.append((-inv[mod % i] * (mod // i)) % mod)
        factinv[i] = (factinv[i-1] * inv[i]) % mod

    def nCr(n,r):
        r = min(r,n-r)
        return (fact[n] * factinv[r] * factinv[n-r]) % mod

    for i in range(K+1):
        tmp = pow(25,i,mod)
        tmp *= nCr(i+n-1,n-1)
        tmp *= pow(26,K-i,mod)
        ans += tmp
        ans %= mod
    print(ans)

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

import sys
import random

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

def rdi():
        return [ int(x) for x in rd().split() ]

K, N = rdi()

if K == 1:
        print " ".join(["1"] * ((N+1)/2))
        sys.exit(0)

if K % 2 == 0:
        print K/2,
        for i in range(N-1):
                print K,
        print
        sys.exit(0)

t = [ K/2+1 ] * N
for i in range(N/2):
        #print t
        if t[-1] == 1:
                #if t[-2] == 1:
                        t = t[:-1]
                #else:
                #       t[-2] -= 1
                #       t = t[:-1] + [ K ] * (N - len(t) + 1)
        else:
                t[-1] -= 1
                t = t + [ K ] * (N - len(t))
        #print t
print " ".join([ str(x) for x in t])

### FIXED CODE ###

import sys
import random

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

def rdi():
        return [ int(x) for x in rd().split() ]

K, N = rdi()

if K == 1:
        print " ".join(["1"] * ((N+1)/2))
        sys.exit(0)

if K % 2 == 0:
        print K/2,
        for i in range(N-1):
                print K,
        print
        sys.exit(0)

t = [ K/2+1 ] * N
j = N-1
for i in range(N/2):
        if t[j] == 1:
                j -= 1
        else:
                t[j] -= 1
                for k in range(j+1, N):
                        t[k] = K
                j = N-1
        #print t
print " ".join([ str(x) for x in t[:j+1]])
### BUGGY CODE ###

import sys
sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))
import math
from itertools import combinations
def resolve():
    eps = 1e-7
    N, K = lr()
    ci = [[] for _ in range(N)]
    _r = []
    for i in range(N):
        x, y, c = lr()
        ci[i].extend([x, y])
        _r.append(c)
    l = 0
    r = 10 ** 6
    while l + eps < r:
        T = (l + r) / 2
        rad = [(T/_r[i])**2 for i in range(N)]
        ans = 0
        xys = []
        for i, j in combinations(range(N), 2):
            cx1, cy1 = ci[i]
            cx2, cy2 = ci[j]
            xt = cx2-cx1
            yt = cy2-cy1
            XY = xt**2+yt**2
            a = (XY+rad[i]-rad[j])/2
            d = XY*rad[i]-a**2
            if d < eps:
                continue
            x1 = (a*xt+yt*math.sqrt(d))/XY+cx1
            y1 = (a*yt-xt*math.sqrt(d))/XY+cy1
            x2 = (a*xt-yt*math.sqrt(d))/XY+cx1
            y2 = (a*yt+xt*math.sqrt(d))/XY+cy1
            xys.append([x1, y1])
            xys.append([x2, y2])
        xys.extend(ci)
        for X, Y in xys:
            tmp = 0
            for (x, y), k in zip(ci, rad):
                if (x-X)**2+(y-Y)**2 < k+eps:
                    tmp += 1
            ans = max(ans, tmp)
            if ans >= K:
                break
        if ans >= K:
            r = T
        else:
            l = T
    print(r)
resolve()

### FIXED CODE ###

import sys
from math import sqrt
from itertools import combinations
def resolve():
    eps = 1e-7
    N, K, *xyc = map(int, sys.stdin.read().split())
    x = xyc[::3]
    y = xyc[1::3]
    ci = list(zip(x, y))
    _r = xyc[2::3]
    l = 0
    r = 10 ** 6
    while l + eps < r:
        T = (l + r) / 2
        rad = [(T/_r[i])**2 for i in range(N)]
        ans = 0
        xys = []
        for i, j in combinations(range(N), 2):
            cx1, cy1 = ci[i]
            cx2, cy2 = ci[j]
            xt = cx2-cx1
            yt = cy2-cy1
            XY = xt**2+yt**2
            a = (XY+rad[i]-rad[j])/2
            d = XY*rad[i]-a**2
            if d < eps:
                continue
            x1 = (a*xt+yt*sqrt(d))/XY+cx1
            y1 = (a*yt-xt*sqrt(d))/XY+cy1
            x2 = (a*xt-yt*sqrt(d))/XY+cx1
            y2 = (a*yt+xt*sqrt(d))/XY+cy1
            xys.append([x1, y1])
            xys.append([x2, y2])
        xys.extend(ci)
        for X, Y in xys:
            tmp = 0
            for (x, y), k in zip(ci, rad):
                if (x-X)**2+(y-Y)**2 < k+eps:
                    tmp += 1
            ans = max(ans, tmp)
            if ans >= K:
                break
        if ans >= K:
            r = T
        else:
            l = T
    print(r)
resolve()
### BUGGY CODE ###

xs,ys,xt,yt=map(int,input().split())
N=int(input())
XYR=[[xs,ys,0]]+[list(map(int,input().split())) for i in range(N)]+[[xt,yt,0]]
c=[[None]*(N+2) for i in range(N+2)]
for i in range(N+2):
    for j in range(N+2):
        c[i][j]=max(1e-12,((XYR[i][0]-XYR[j][0])**2+(XYR[i][1]-XYR[j][1])**2)**.5-XYR[i][2]-XYR[j][2])
from scipy.sparse import*
g=csr_matrix(c)
print("%.12f"%csgraph.dijkstra(g,directed=0,indices=0)[-1])

### FIXED CODE ###

xs,ys,xt,yt=map(int,input().split())
N=int(input())
import numpy as np
XYR=np.empty((N+2,3),dtype=np.float64)
XYR[1:-1,:]=np.array([input().split() for i in range(N)])
XYR[0,:]=xs,ys,0
XYR[-1,:]=xt,yt,0
X,Y,R=XYR.T
c=np.maximum(0,np.sqrt(np.square(X[None,:]-X[:,None])+np.square(Y[None,:]-Y[:,None]))-R[None,:]-R[:,None])
c[range(N+2),range(N+2)]=-1
from scipy.sparse import*
g=csgraph.csgraph_from_dense(c,null_value=-1)
print(csgraph.dijkstra(g,indices=0)[-1])
### BUGGY CODE ###

# coding: utf-8


def yakusu(n):
    ans = []
    for i in range(1, int(n**0.5) + 1):
        if n % i == 0:
            ans.append(i)
            if n // i != i:
                ans.append(n // i)
    
    return sorted(ans)


def main():
    N = int(input())

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

    is_in_A_flag = [0] * (10**6+1)

    for a in A:
        is_in_A_flag[a] += 1

    B = [None] * N
    for i in range(N):
        B[i] = yakusu(A[i])

    ans = 0
    for i in range(N):
        is_ans = True
        for b in B[i][:-1]:
            if is_in_A_flag[b] > 0:
                is_ans = False
                break
        
        if is_ans:
            if is_in_A_flag[B[i][-1]] > 1:
                is_ans = False

        if is_ans:
            ans += 1

    return ans


print(main())


### FIXED CODE ###

# coding: utf-8

# 13:42- kaisetsu and try again
# -14:03 giveup (WA*6) -> testcase


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

    M = 10**6
    is_ans_flag = [0] * (M+1)
    n_appeared_in_A = [0] * (M+1)
    for a in A:
        n_appeared_in_A[a] += 1
        is_ans_flag[a] = 1

    for a in A:
        if n_appeared_in_A[a] == -1:
            continue

        if n_appeared_in_A[a] >= 2:
            is_ans_flag[a] = 0

        for i in range(2, M+1):
            if a*i > M:
                break
            is_ans_flag[a*i] = 0

        n_appeared_in_A[a] = -1

    return sum(is_ans_flag)


print(main())
### BUGGY CODE ###

R, C, K = map(int, input().split())
D = dict()
for _ in range(K):
    r, c, v = map(int, input().split())
    D[(r, c)] = v

dp = [[[0] * 4 for _ in range(C + 1)] for _ in range(R + 1)]
for r in range(1, R + 1):
    for c in range(1, C + 1):
        for n in range(4):
            dp[r][c][n] = max(max(dp[r - 1][c]),
                              dp[r][c - 1][n])
        if (r, c) in D:
            for n in range(3):
                dp[r][c][n + 1] = max(dp[r][c][n + 1],
                                      max(dp[r - 1][c]) + D[(r, c)],
                                      dp[r][c - 1][n] + D[(r, c)])
print(max(dp[-1][-1]))


### FIXED CODE ###

import sys

input = sys.stdin.readline

R, C, K = map(int, input().split())
D = dict()
for _ in range(K):
    r, c, v = map(int, input().split())
    D[(r, c)] = v

dp0 = [[0] * (C + 1) for _ in range(R + 1)]
dp1 = [[0] * (C + 1) for _ in range(R + 1)]
dp2 = [[0] * (C + 1) for _ in range(R + 1)]
dp3 = [[0] * (C + 1) for _ in range(R + 1)]

for r in range(1, R + 1):
    for c in range(1, C + 1):
        m = max(dp0[r - 1][c], dp1[r - 1][c], dp2[r - 1][c], dp3[r - 1][c])
        dp0[r][c] = max(m, dp0[r][c - 1])
        dp1[r][c] = max(m, dp1[r][c - 1])
        dp2[r][c] = max(m, dp2[r][c - 1])
        dp3[r][c] = max(m, dp3[r][c - 1])
        if (r, c) in D:
            dp1[r][c] = max(dp1[r][c], m + D[(r, c)], dp0[r][c - 1] + D[(r, c)])
            dp2[r][c] = max(dp2[r][c], m + D[(r, c)], dp1[r][c - 1] + D[(r, c)])
            dp3[r][c] = max(dp3[r][c], m + D[(r, c)], dp2[r][c - 1] + D[(r, c)])
print(max(dp0[-1][-1], dp1[-1][-1], dp2[-1][-1], dp3[-1][-1]))
### BUGGY CODE ###

#!/usr/bin/env python3
import sys
 
 
def solve(K: int, S: int):
    cnt = 0
    for a in range(K + 1):
        for b in range(K + 1):
            for c in range(K + 1):
                if a + b + c == S:
                    cnt += 1
    print(cnt)
    return
 
 
# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    K = int(next(tokens))  # type: int
    S = int(next(tokens))  # type: int
    solve(K, S)
 
if __name__ == '__main__':
    main()

### FIXED CODE ###

#!/usr/bin/env python3
import sys
 
 
def solve(K: int, S: int):
    cnt = 0
    for a in range(K + 1):
        for b in range(K + 1):
            tmp = S - (a + b)
            if 0 <= tmp and tmp <= K:
                cnt += 1 
    print(cnt)
    return
 
 
# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    K = int(next(tokens))  # type: int
    S = int(next(tokens))  # type: int
    solve(K, S)
 
if __name__ == '__main__':
    main()
### BUGGY CODE ###

N,M=map(int,input().split())
a=[int(input()) for i in range(M)]
dp=[1]*(N+1)
dp[0]=1
dp[1]=1

for i in range(1,N+1):
    if i in a:
        dp[i]=0
    elif i==1:
        pass
    else:
        dp[i]=(dp[i-1]+dp[i-2])%1000000007

print(dp[N])

### FIXED CODE ###

N,M=map(int,input().split())
dp=[0]*(N+3)
dp[0]=1
a=[0]*(N+3)
for i in range(M):
    a[int(input())]=1
mod=10**9+7

for i in range(N+1):
    if a[i+1] != 1:
        dp[i+1]+=dp[i]
        dp[i+1]%=mod
    if a[i+2] != 1:
        dp[i+2]+=dp[i]
        dp[i+2]%=mod

print(dp[N])
### BUGGY CODE ###

N=int(input())
A=list(map(int,input().split()))
for i in range(1,N):
  print(A.count(i))
print(0)

### FIXED CODE ###

N = int(input())
A = map(int,input().split())
c=[]
for i in range (N):
  c.append(0)
for j in A:
  c[j-1]+=1

for C in c:
  print(C)
### BUGGY CODE ###

n=int(input())
a=list(map(int,input().split()))
ans=[]
for i in range(1,n+1):
    ans.append(a.count(i))
for k in range(len(ans)):
    print(ans[k])



### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
ans=[0]*n
for i in a:
    ans[i-1]+=1
for k in ans:
    print(k)
### BUGGY CODE ###

import sys
sys.setrecursionlimit(10**6)

n,u,v = map(int, input().split())
adjacent_list = [[]for i in range(n+1)]
aoki = [0 for i in range(n+1)]
takahashi = [0 for i in range(n+1)]
for i in range(n-1):
    a,b = map(int ,input().split())
    adjacent_list[a].append(b)
    adjacent_list[b].append(a)

def dfs(node, count,li):
    li[node] = count
    finished.add(node)
    for i in adjacent_list[node]:
        if i not in finished:
            dfs(i, count + 1,li)
def search_path(node,t):
    if node == t:
        return
    finished.add(node)
    for i in adjacent_list[node]:
        if i not in finished:
            pre_node[i] = node
            search_path(i, t)
finished = set()
dfs(u,0,takahashi)
finished = set()
dfs(v,0,aoki)
finished = set()
path = []
pre_node = [0 for i in range(n+1)]
#最短炉を出す
search_path(u,v)
while v != u:
    path = [v] + path
    v = pre_node[v]
start = u

#ギリギリまで高橋君に近づく
for i in range(len(path)-1):
    if aoki[path[i+1]] <= i+1:
        start = path[i]
        break
finished = set()
#近づいたとこからdfs
ans_path = [0 for i in range(n+1)]
dfs(start,0,ans_path)
ans = 0
for i in range(1,n+1):
    if aoki[i] >= takahashi[start] + ans_path[i]:
        ans = max(ans, ans_path[i])
print(ans + aoki[start] - 1)


### FIXED CODE ###

import sys
sys.setrecursionlimit(10**6)
input = sys.stdin.readline

n,u,v = map(int, input().split())
adjacent_list = [[] for i in range(n+1)]
aoki = [0 for i in range(n+1)]
takahashi = [0 for i in range(n+1)]
for i in range(n-1):
    a,b = map(int ,input().split())
    adjacent_list[a].append(b)
    adjacent_list[b].append(a)

def dfs(node, count,li):
    global node_par
    li[node] = count
    finished.add(node)
    for i in adjacent_list[node]:
        if i not in finished:
            node_par[i] = node
            dfs(i, count + 1,li)
        
node_par = [0 for i in range(n+1)]

finished = set()
dfs(u,0,takahashi)

#辿って親保存しとく
finished = set()
dfs(v,0,aoki)

#さかのぼれるとこまで行く,startがさかのぼれる最大のノーど
par = u
start = u
while takahashi[par] < aoki[par]:
    start = par
    par = node_par[start]

ans_height = [0 for i in range(n+1)]
finished = set([node_par[start]])
dfs(start,0,ans_height)
print(max(ans_height) + aoki[start] - 1)
### BUGGY CODE ###

N, K, Q = map(int, input().split())
A = []
for _ in range(Q):
    A.append(int(input()))


for n in range(N):
    freq = A.count(n + 1)
    if K > Q:
        print('Yes')
    elif K - Q + freq <= 0:
        print('No')
    else:
        print('Yes')





### FIXED CODE ###

N, K, Q = map(int, input().split())
index_list = [int(input()) - 1 for i in range(Q)]

zero_list = [0 for n in range(N)]

ori = K - Q
for i in range(Q):
    zero_list[index_list[i]] += 1
for i in range(N):
    zero_list[i] += ori
for i in range(N):
    if zero_list[i] > 0:
        print('Yes')
    else:
        print('No')

# shakayamiさんのコードを参考にしました
# for文が入れ子になると遅くなるから，出来るだけそうしない