#include <iostream>
using namespace std;
const int N = 1E4 + 10;
typedef long long ll;
ll a[N], dp[30][N];
int main(){
int n, m; cin >> n >> m;
for(int i = 1; i <= n; i ++ ) cin >> a[i];
dp[0][0] = 1;
for(int i = 1; i <= n; i ++ ){
for(int j = 0; j <= m; j ++ ){
dp[i][j] += dp[i - 1][j];
if(j >= a[i]) dp[i][j] += dp[i][j - a[i]];
}
}
cout << dp[n][m] << endl;
return 0;
}