#include <iostream>
#include <cstdio>
using namespace std;
const int M = 10010, N = 110;
int f[M];
int dig[N];
int main()
{
int n, m;
cin >> n >> m;
f[0] = 1; // 当i = 0, 考虑前0个数使和为0时,有1种选择
for (int i = 1; i <= n; i ++){
scanf("%d", dig + i);
}
for (int i = 1; i <= n; i ++)
for (int j = m; j >= dig[i]; j --)
f[j] += f[j - dig[i]];
cout << f[m] << endl;
return 0;
}