#include using namespace std; typedef long long ll; typedef vector VI; typedef vector VVI; #define REP(i, n) for(int(i)=0;(i)<(n);++(i)) const int MOD = 1234567891; ll N,M; int A[55]; int dp[111111]; int main(){ cin >> N >> M; REP(i,N) cin >> A[i]; if(M >= 1e8) throw "記念submit!"; for(int i = 0; i < 111111; i += A[0]){ dp[i] = 1; } for(int i = 1; i < N; i++){ for(int j = A[i]; j < 111111; j++){ dp[j] += dp[j-A[i]]; } } cout << dp[M] << endl; return 0; }