(defparameter n (read))
(defparameter x (read))
(defparameter a (loop repeat n
                      collect (read)))

(defun f (x a c)
  (let ((head (car a))
        (tail (cdr a)))
    (if (< x head)
        c
        (f (- x head) tail (1+ c)))))

(defun g (x a c)
  (if (null a)
      (1- c)
      (g (- x (car a)) (cdr a) (1+ c))))

(princ
  (if (< x (apply #'+ a))
      (f x (sort a #'<) 0)
      (g x (sort a #'>) 0)))