#include <bits/stdc++.h>
#ifdef __DEBUG__
    #define DBG(X) cout << #X << " = " << (X) << endl;
    #define SAY(X) cout << (X) << endl;
#else
    #define DBG(X)
    #define SAY(X)
#endif

using namespace std;

using ll = long long int;
using ull = unsigned long long int;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

int dx[]={1, 0, -1, 0, 1,-1, 1,-1};
int dy[]={0, 1, 0, -1, 1, 1,-1,-1};
const int INT_INF = (int)(2e9);
const ll  LL_INF = (ll)(2e18);

inline void fast_io() { ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); };
template<typename T, typename S> inline ostream& operator<<(ostream& os, const pair<T, S> p) { cout << "[" << p.first << ";" << p.second << "]"; return os; }
template<typename T, typename S> inline ostream& operator<<(ostream& os, const map<T, S> p) { for (auto el : p) cout << "[" << el.first << ";" << el.second << "]"; return os; }
template<typename T> inline ostream& operator<<(ostream& os, const vector<T>& v) { for (auto el : v) cout << el << " "; return os; }
template<typename T> inline ostream& operator<<(ostream& os, const deque<T>& v) { for (auto el : v) cout << el << " "; return os; }
template<typename T> inline ostream& operator<<(ostream& os, const set<T>& v) { for (auto el : v) cout << el << " "; return os; }
template<typename T> inline vector<T> fetch_vec(int sz) { vector<T> ret(sz); for (auto& elem : ret) cin >> elem; return ret; }

int N,K;
vector<ll> A;
void input(){
    fast_io();
    cin >> N >> K;
    // A = fetch_vec<ll>(N);
    for (int i = 0; i < N; i++)
    {
        ll a; cin >> a;
        if(a>=K) continue;
        A.push_back(a);
    }
    N = A.size();
}

int solve(){
    sort(A.begin(),A.end());
    int ans = 0;

    vector<vector<bool>> dp_left(N+1,vector<bool>(10010,false)),dp_right(N+1,vector<bool>(10010,false));;
    // Aからつくる部分和の集合
    dp_left[0][0] = true;
    dp_right[N][0] = true;
    for (int i = 0; i < N; i++)
    {
        for (int x = 10000; x >= 0; x--)
        {
            if(dp_left[i][x]) dp_left[i+1][x] = true;
            if(dp_left[i][x] && x+A[i]<=10000) dp_left[i+1][x+A[i]] = true;
        }
    }

    for (int i = N; i > 0; i--)
    {
        for (int x = 10000; x >= 0; x--)
        {
            if(dp_right[i][x]) dp_right[i-1][x] = true;
            if(dp_right[i][x] && x+A[i]<=10000) dp_right[i-1][x+A[i-1]] = true;
        }
    }
    // dp_left[i]..[0,i)
    // dp_right[i]..[i,N)

    DBG(A)
    for (int i = 0; i < N; i++)
    {
        bool no_need = true;
        vector<int> dpL,dpR;
        for (int x = 0; x < K; x++) if(dp_left[i][x]) dpL.push_back(x);
        for (int y = 0; y < K; y++) if(dp_right[i+1][y]) dpR.push_back(y);
        for(int x:dpL){
            auto itr = lower_bound(dpR.begin(),dpR.end(),K-x-A[i]);
            if(itr==dpR.end()) continue;
            int y = *itr;
            if(x+y>=K) continue;
            // if(dp_left[i][x] && dp_right[i+1][y] && x+y+A[i]>=K){
                no_need = false;
                break;
            // }
        }
        if(no_need) ans++;
    }
    
    cout << ans << endl;
    return 0;
}   

int main()
{
    input();
    solve();
    return 0;
}

Measured memory_bytes: 16124