open Printf open Scanf
open Array

let rv f p q = f q p

module ISet = Set.Make(struct
  type t = int
  let compare = rv compare
end)

let () = scanf " %d %d" @@ fun n k ->
  let a = init n (fun _ -> scanf " %d" @@ fun v -> v) in
  sort (rv compare) a;
  let ans = ref 0 in
  let _ = fold_left (fun (s,i) v ->
    if v >= k then (
      ans := i+1; (s,i+1)
    ) else
      let s = ref s in
      ISet.iter (fun w ->
        if w+v < k then s := ISet.add (w+v) !s
        else ans := i+1
      ) !s;
      (ISet.add v !s, i+1)
  ) (ISet.empty,0) a in
  print_int @@ n - !ans



