#include <iostream>
using namespace std;
const int M = 100010, N = 11;
int dp[N][M], n, m, q[N];
int main()
{
cin >> n >> m;
for(int i = 0; i < n; i ++) dp[i][0] = 1;
for(int i = 1; i <= n; i ++) cin >> q[i];
for(int i = 1; i <= n; i ++)
{
for(int j = 1; j <= m; j ++)
{
dp[i][j] = dp[i - 1][j];
if(j >= q[i])
dp[i][j] += dp[i - 1][j - q[i]];
}
}
cout << dp[n][m] << endl;
}