open Printf open Scanf
open Array

let rv f p q = f q p

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 dp = make (k+1) false in
  iteri (fun i v ->
    if v>=k then ans := i+1
    else (
      for w=k downto 1 do
        if dp.(w) then (
          if w+v < k then dp.(w+v) <- true
          else ans := i+1
        )
      done;
      dp.(v) <- true;
    )
  ) a;
  print_int @@ n - !ans



