open System

let [|n; x|] = stdin.ReadLine().Split() |> Array.map int
let a = 
    stdin.ReadLine().Split() 
    |> Array.map int 
    |> Array.sort 
    |> List.ofArray

let rec f k = function 
    | [x] -> if k = x then 1 else 0
    | x :: xs -> if k >= x then 1 + f (k-x) xs else 0

printfn "%d" <| f x a

