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.

def poppin(a, k):
    if len(a) == 0:
        return -1
    sum_ = 0
    for i in range(len(a)):
        sum_ += a[i]
        if(sum_ >= k):
            return i
    return -1



def pop_(a, ind):
    for i in range(ind + 1):
        a.pop(0)


def main():
    n, k = list(map(int, input().split()))
    a = list(map(int, input().split()))
    a.sort()
    a = a[::-1]

    while 0 == 0:
        d = poppin(a, k)
        if d == -1:
            break
        pop_(a, d)
    print(len(a))

import numpy as np

def main():
    def check(m):
        DP = np.full(k+1, False)
        DP[0] = True
        for i in range(n):
            if i == m:
                continue
            DP[a[i]:] = np.logical_or(DP[a[i]:], DP[:k+1-a[i]])
        return any(DP[i] for i in range(k-a[m], k))

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

    a = [i for i in a if i <k]
    a.sort()
    n = len(a)

    left = -1
    right = n

    while right-left > 1:
        mid = (right+left)//2
        if check(mid):
            right = mid
        else:
            left = mid

    print(right)

main()