#include <iostream>
#include <algorithm>
#include <numeric>
using namespace std;
long long buffer[10001][3];
int coin[101];
int main() {
ios::sync_with_stdio(false);
cin.tie(NULL);
int n,k;
cin >> n >> k;
for (int i=1; i<=n; i++){
cin >> coin[i];
}
for (int i =1; i<=k; i++){
buffer[i][1] = (i%coin[1] == 0)? 1 : 0;
}
if (n > 1) {
for (int j = 2; j <= n; j++) {
for (int i = 1; i <= k; i++) {
if (i - coin[j] == 0) buffer[i][j % 2] = buffer[i][(j-1)%2] + 1;
else if (i - coin[j] > 0) buffer[i][j %2] = buffer[i][(j - 1)%2] + buffer[i - coin[j]][j%2];
else buffer[i][j%2] = buffer[i][(j - 1)%2];
}
}
}
// for (int i = 1; i<=k ; i++){
// for (int j = 1; j <= n; j++){
// cout << i << ' ' << j<<' '<<buffer[i][j] << ' ';
// }
// cout << '\n';
// }
cout << buffer[k][n%2];
return 0;
}