https://www.acwing.com/problem/content/1373/
#include<bits/stdc++.h>
using namespace std;
#define in long long
in v,n;
const in N=30;
in m[N];
in ans[N][10010];
int main(){
cin>>v>>n;
for(in i=1;i<=v;i++)
cin>>m[i];
ans[0][0]=1;
for(in i=1;i<=v;i++)
for(in j=0;j<=n;j++){
for(in o=0;o*m[i]<=j;o++){
ans[i][j]+=ans[i-1][j-o*m[i]];
}
}
cout<<ans[v][n]<<endl;
return 0;
}