import std.algorithm, std.conv, std.range, std.stdio, std.string;

const mod1 = 10 ^^ 9 + 7;
const mod2 = 10 ^^ 9 + 9;

alias mint1 = FactorRing!mod1;
alias mint2 = FactorRing!mod2;

void main()
{
  auto rd = readln.split.to!(int[]), n = rd[0], k = rd[1];
  auto a = readln.split.to!(int[]);

  auto calcDp(T)()
  {
    auto dp = new T[][](n+1, k+1);
    dp[0][0] = 1;

    foreach (i; 0..n)
      foreach (j; 0..k+1) {
        dp[i+1][j] = dp[i][j];
        if (j >= a[i]) dp[i+1][j] += dp[i][j-a[i]];
      }

    return dp[$-1];
  }

  auto calcDpBack(T)(T[] dp, int ai)
  {
    if (ai >= k) return dp;
    auto dpb = new T[](k+1);
    dpb[0..ai][] = dp[0..ai][];
    foreach (i; ai..k+1) dpb[i] = dp[i] - dpb[i-ai];
    return dpb;
  }

  auto dp1 = calcDp!mint1();
  auto dp2 = calcDp!mint2();

  auto ans = 0;
  foreach (i; 0..n) {
    auto dpb1 = calcDpBack(dp1, a[i]);
    auto dpb2 = calcDpBack(dp2, a[i]);
    auto mi = max(1, k-a[i]);
    if (dpb1[mi..k].any!(dpi => dpi != 0) || dpb2[mi..k].any!(dpi => dpi != 0))
      ++ans;
  }

  writeln(n-ans);
}

struct FactorRing(int m, bool pos = false)
{
  version(BigEndian) {
    union { long vl; struct { int vi2; int vi; } }
  } else {
    union { long vl; int vi; }
  }

  @property int toInt() { return vi; }
  alias toInt this;

  this(int v) { vi = v; }
  this(int v, bool runMod) { vi = runMod ? mod(v) : v; }
  this(long v) { vi = mod(v); }

  ref FactorRing!(m, pos) opAssign(int v) { vi = v; return this; }

  pure auto mod(int v) const
  {
    static if (pos) return v % m;
    else return (v % m + m) % m;
  }

  pure auto mod(long v) const
  {
    static if (pos) return cast(int)(v % m);
    else return cast(int)((v % m + m) % m);
  }

  static if (m < int.max / 2) {
    pure auto opBinary(string op: "+")(int rhs) const { return FactorRing!(m, pos)(mod(vi + rhs)); }
    pure auto opBinary(string op: "-")(int rhs) const { return FactorRing!(m, pos)(mod(vi - rhs)); }
  } else {
    pure auto opBinary(string op: "+")(int rhs) const { return FactorRing!(m, pos)(mod(vl + rhs)); }
    pure auto opBinary(string op: "-")(int rhs) const { return FactorRing!(m, pos)(mod(vl - rhs)); }
  }
  pure auto opBinary(string op: "*")(int rhs) const { return FactorRing!(m, pos)(mod(vl * rhs)); }

  pure auto opBinary(string op)(FactorRing!(m, pos) rhs) const
    if (op == "+" || op == "-" || op == "*") { return opBinary!op(rhs.vi); }

  static if (m < int.max / 2) {
    auto opOpAssign(string op: "+")(int rhs) { vi = mod(vi + rhs); }
    auto opOpAssign(string op: "-")(int rhs) { vi = mod(vi - rhs); }
  } else {
    auto opOpAssign(string op: "+")(int rhs) { vi = mod(vl + rhs); }
    auto opOpAssign(string op: "-")(int rhs) { vi = mod(vl - rhs); }
  }
  auto opOpAssign(string op: "*")(int rhs) { vi = mod(vl * rhs); }

  auto opOpAssign(string op)(FactorRing!(m, pos) rhs)
    if (op == "+" || op == "-" || op == "*") { return opOpAssign!op(rhs.vi); }
}
