(defun main (&rest argv) (declare (ignorable argv)) (let* ((n (read)) (k (read)) (a (make-array n)) (m1 998244353) (m2 998) (res 0)) (dotimes (i n) (setf (aref a i) (read))) (labels ((f (p q r) (when (= (length p) k) (when (<= (mod r m1) (mod r m2)) (incf res))) (loop for i from q below n do (push (aref a i) p) (f p (1+ i) (+ r (aref a i))) (pop p)))) (f nil 0 0)) (format t "~d~%" (mod res m2)))) (main)