import std.stdio, std.array, std.string, std.conv, std.algorithm;
import std.typecons, std.range, std.random, std.math, std.container;
import std.numeric, std.bigint, core.bitop, core.stdc.stdio;

void main() {
    auto s = readln.split.map!(to!int);
    auto N = s[0];
    auto K = s[1];
    auto A = readln.split.map!(to!long).array;
    A.sort();

    if (A.sum < K) {
        N.writeln;
        return;
    }


    int ans = 0;
    int hi = N-1;
    int lo = -1;
    while (hi -lo > 1) {
        int mid = (hi + lo) / 2;

        if (A[mid] >= K) {
            hi = mid;
            continue;
        }

        bool[long] mem;
        mem[0] = true;

        foreach (j; 0..N) {
            if (mid == j) continue;
            if (A[j] >= K) break;
            foreach (k; mem.keys) {
                auto sm = A[j] + k;
                if (sm > K) continue;
                mem[sm] = true;
            }
            mem[A[j]] = true;
        }

        bool flag = false;
        foreach (j; K-A[mid]..K) {
            if (j in mem) {
                flag = true;
                break;
            }
        }

        if (flag) hi = mid;
        else lo = mid;

    }

    (lo+1).writeln;
}
