#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 7;
int n, s, a[maxn], f[201][50005];
int main(){
cin >> n >> s;
for(int i = 1; i <= n; ++i)
cin >> a[i];
f[0][0] = 1;
for(int i = 1; i <= n; ++i){
f[i][0] = 1;
for(int j = 1; j <= s; ++j){
f[i][j] = f[i-1][j];
if(j - a[i] >= 0){
f[i][j] = max(f[i][j], f[i-1][j-a[i]]);
}
}
}
cout << f[n][s];
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7Cgpjb25zdCBpbnQgbWF4biA9IDFlNiArIDc7CgppbnQgbiwgcywgYVttYXhuXSwgZlsyMDFdWzUwMDA1XTsKCmludCBtYWluKCl7CiAgICBjaW4gPj4gbiA+PiBzOwogICAgZm9yKGludCBpID0gMTsgaSA8PSBuOyArK2kpCiAgICAgICAgY2luID4+IGFbaV07CiAgICBmWzBdWzBdID0gMTsKCiAgICBmb3IoaW50IGkgPSAxOyBpIDw9IG47ICsraSl7CiAgICAgICAgZltpXVswXSA9IDE7CiAgICAgICAgZm9yKGludCBqID0gMTsgaiA8PSBzOyArK2opewogICAgICAgICAgICBmW2ldW2pdID0gZltpLTFdW2pdOwogICAgICAgICAgICBpZihqIC0gYVtpXSA+PSAwKXsKICAgICAgICAgICAgICAgIGZbaV1bal0gPSBtYXgoZltpXVtqXSwgZltpLTFdW2otYVtpXV0pOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgfQogICAgY291dCA8PCBmW25dW3NdOwogICAgcmV0dXJuIDA7Cn0K