AtCoDeer the deer has N cards with positive integers written on them. The number on the i-th card (1≤i≤N) is a_i.
Because he loves big numbers, he calls a subset of the cards good when the sum of the numbers written on the cards in the subset, is K or greater.
Then, for each card i, he judges whether it is unnecessary or not, as follows:
 - If, for any good subset of the cards containing card i, the set that can be obtained by eliminating card i from the subset is also good, card i is unnecessary.
 - Otherwise, card i is NOT unnecessary.
Find the number of the unnecessary cards. Here, he judges each card independently, and he does not throw away cards that turn out to be unnecessary.

-----Constraints-----
 - All input values are integers.
 - 1≤N≤5000
 - 1≤K≤5000
 - 1≤a_i≤10^9 (1≤i≤N)

-----Partial Score-----
 - 300 points will be awarded for passing the test set satisfying N,K≤400.

-----Input-----
The input is given from Standard Input in the following format:
N K
a_1 a_2 ... a_N

-----Output-----
Print the number of the unnecessary cards.

-----Sample Input-----
3 6
1 4 3

-----Sample Output-----
1

There are two good sets: {2,3} and {1,2,3}.
Card 1 is only contained in {1,2,3}, and this set without card 1, {2,3}, is also good. Thus, card 1 is unnecessary.
For card 2, a good set {2,3} without card 2, {3}, is not good. Thus, card 2 is NOT unnecessary.
Neither is card 3 for a similar reason, hence the answer is 1.

Difficulty: MEDIUM_HARD

Solutions:
(N, K) = map(int, input().split())
A = list(map(int, input().split()))
RA = sorted(A)
RA = RA[::-1]
s = 0
ans = 0
for i in range(N):
	a = RA[i]
	if s + a < K:
		s += a
		ans += 1
	else:
		ans = 0
print(ans)


import sys
input = sys.stdin.readline
(N, K) = map(int, input().split())
a = list(map(int, input().split()))
a.sort(reverse=True)
t = 0
res = -1
for i in range(N):
	if t + a[i] < K:
		t += a[i]
	else:
		res = i
print(N - res - 1)


(n, k) = map(int, input().split())
a = list(map(int, input().split()))
a.sort(reverse=True)
ans = n
(s, cnt) = (0, 0)
for i in a:
	cnt += 1
	if s + i < k:
		s += i
	else:
		ans = n - cnt
print(ans)


(n, k) = map(int, input().split())
a = sorted(map(int, input().split()), reverse=True)
s = 0
need = 0
for i in range(n):
	if s + a[i] < k:
		s += a[i]
	else:
		need = i + 1
print(n - need)


def I():
	return int(input())

def MI():
	return map(int, input().split())

def LI():
	return list(map(int, input().split()))

def main():
	(N, K) = MI()
	a = LI()
	a.sort(reverse=True)
	temp = 0
	ans = N
	for i in range(N):
		if temp + a[i] < K:
			temp += a[i]
		else:
			ans = min(ans, N - i - 1)
	print(ans)
main()


import sys
input = sys.stdin.readline
import math
import bisect
import heapq
from collections import defaultdict
from collections import deque
from collections import Counter
from functools import lru_cache
MOD = 10 ** 9 + 7
INF = float('inf')
AZ = 'abcdefghijklmnopqrstuvwxyz'

def I():
	return int(input().strip())

def S():
	return input().strip()

def IL():
	return list(map(int, input().split()))

def SL():
	return list(map(str, input().split()))

def ILs(n):
	return list((int(input()) for _ in range(n)))

def SLs(n):
	return list((input().strip() for _ in range(n)))

def ILL(n):
	return [list(map(int, input().split())) for _ in range(n)]

def SLL(n):
	return [list(map(str, input().split())) for _ in range(n)]

def P(arg):
	print(arg)
	return

def Y():
	print('Yes')
	return

def N():
	print('No')
	return

def E():
	exit()

def PE(arg):
	print(arg)
	exit()

def YE():
	print('Yes')
	exit()

def NE():
	print('No')
	exit()

def DD(arg):
	return defaultdict(arg)

def inv(n):
	return pow(n, MOD - 2, MOD)
kaijo_memo = []

def kaijo(n):
	if len(kaijo_memo) > n:
		return kaijo_memo[n]
	if len(kaijo_memo) == 0:
		kaijo_memo.append(1)
	while len(kaijo_memo) <= n:
		kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
	return kaijo_memo[n]
gyaku_kaijo_memo = []

def gyaku_kaijo(n):
	if len(gyaku_kaijo_memo) > n:
		return gyaku_kaijo_memo[n]
	if len(gyaku_kaijo_memo) == 0:
		gyaku_kaijo_memo.append(1)
	while len(gyaku_kaijo_memo) <= n:
		gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo), MOD - 2, MOD) % MOD)
	return gyaku_kaijo_memo[n]

def nCr(n, r):
	if n == r:
		return 1
	if n < r or r < 0:
		return 0
	ret = 1
	ret = ret * kaijo(n) % MOD
	ret = ret * gyaku_kaijo(r) % MOD
	ret = ret * gyaku_kaijo(n - r) % MOD
	return ret

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.append([i, cnt])
	if temp != 1:
		arr.append([temp, 1])
	if arr == []:
		arr.append([n, 1])
	return arr

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

def make_primes(N):
	max = int(math.sqrt(N))
	seachList = [i for i in range(2, N + 1)]
	primeNum = []
	while seachList[0] <= max:
		primeNum.append(seachList[0])
		tmp = seachList[0]
		seachList = [i for i in seachList if i % tmp != 0]
	primeNum.extend(seachList)
	return primeNum

def gcd(a, b):
	while b:
		(a, b) = (b, a % b)
	return a

def lcm(a, b):
	return a * b // gcd(a, b)

def count_bit(n):
	count = 0
	while n:
		n &= n - 1
		count += 1
	return count

def base_10_to_n(X, n):
	if X // n:
		return base_10_to_n(X // n, n) + [X % n]
	return [X % n]

def base_n_to_10(X, n):
	return sum((int(str(X)[-i - 1]) * n ** i for i in range(len(str(X)))))

def base_10_to_n_without_0(X, n):
	X -= 1
	if X // n:
		return base_10_to_n_without_0(X // n, n) + [X % n]
	return [X % n]

def int_log(n, a):
	count = 0
	while n >= a:
		n //= a
		count += 1
	return count
(N, K) = IL()
A = IL()
A.sort(reverse=True)
ans = 0
now = 0
cnt = 0
for i in range(N):
	a = A[i]
	if now + a >= K:
		ans += cnt + 1
		cnt = 0
	else:
		now += a
		cnt += 1
print(N - ans)


(N, K) = list(map(int, input().split()))
A = list(map(int, input().split()))
A.sort(reverse=True)
ans = 0
sum = 0
cnt = 0
for i in range(N):
	a = A[i]
	if sum + a >= K:
		ans += cnt + 1
		cnt = 0
	else:
		sum += a
		cnt += 1
print(N - ans)


(n, k) = list(map(int, input().split()))
l = list(map(int, input().split()))
l.sort(reverse=True)
a = 0
maisu = 0
end_maisu = 0
ans = 0
for i in range(n):
	maisu += 1
	a += l[i]
	if a >= k:
		a -= l[i]
		ans += 1
		end_maisu = maisu
		maisu -= 1
end_maisu -= 1
if end_maisu < 0:
	end_maisu = 0
print(n - ans - end_maisu)


(N, K) = map(int, input().split())
_A = list(map(int, input().split()))
A = []
ans = 0
for a in _A:
	if a >= K:
		ans += 1
	else:
		A.append(a)
M = len(A)
A.sort(reverse=True)
confilm = [0 for _ in range(N)]
sumA = [0 for _ in range(M + 1)]
for i in range(1, M + 1):
	sumA[i] = sumA[i - 1] + A[i - 1]
left = 0
right = 1
while right < M:
	while sumA[right] - sumA[left] >= K:
		left += 1
	for check in range(right, M):
		if sumA[right] - sumA[left] + A[check] >= K:
			confilm[check] = 1
			for i in range(left, right):
				confilm[i] = 1
	right += 1
ans += sum(confilm)
print(N - ans)


(N, K) = map(int, input().split())
A = list(map(int, input().split()))
A.sort()
need = []
iranaiko = []
for a in A:
	if a >= K:
		need.append(a)
	elif a in need:
		need.append(a)
	elif a in iranaiko:
		pass
	else:
		z = 0
		B = A[:]
		B.remove(a)
		fusoku = [K - i - 1 for i in range(a)]
		for (bi, b) in enumerate(B):
			if b >= K:
				bi = bi - 1
				break
		B = B[:bi + 1]
		B.reverse()
		C = [0]
		for b in B:
			D = []
			for c in C:
				if b + c < K:
					if b + c in fusoku:
						z = 1
						need.append(a)
						break
					D.append(b + c)
			D.append(0)
			C = D[:]
			if z == 1:
				break
		if z == 0:
			iranaiko.append(a)
print(N - len(need))


from collections import Counter
(N, K) = list(map(int, input().split()))
a = list(map(int, input().split()))
a.sort()
a.reverse()
tmp = []
tmp_sum = 0
b = []
for i in a:
	if tmp_sum + i >= K:
		b.append(i)
	else:
		tmp.append(i)
		tmp_sum += i
if len(b) == 0:
	print(N)
else:
	min_num = b[-1]
	c = Counter(a)
	print(N - (a.index(min_num) + c[min_num]))


import sys
sys.setrecursionlimit(300000)

def solve(N: int, K: int, a: 'List[int]'):
	a.sort(reverse=True)
	dp = [False] * K
	dp[0] = True
	ret = 0
	for i in range(N):
		for j in range(K - 1, -1, -1):
			if dp[j]:
				if j + a[i] >= K:
					ret = i + 1
				else:
					dp[j + a[i]] = True
	print(N - ret)
	return

def main():

	def iterate_tokens():
		for line in sys.stdin:
			for word in line.split():
				yield word
	tokens = iterate_tokens()
	N = int(next(tokens))
	K = int(next(tokens))
	a = [int(next(tokens)) for _ in range(N)]
	solve(N, K, a)
main()