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!int).array;
    A.sort();

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

    int ans = 0;
    bool[int] used;
    foreach (i; 0..N) {
        long acm = 0;
        if (A[i] in used) {
            ans += used[A[i]];
            continue;
        }
        foreach (j; i..N) {
            acm += A[j];
            if (acm >= K) {
                if (acm - A[i] >= K) {
                    ans += 1;
                    used[A[i]] = true;
                }
                break;
            }
        }
        if (!(A[i] in used)) used[A[i]] = false;
    }

    ans.writeln;
}
