#include<bits/stdc++.h>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define HUGE_NUM 4000000000000000000 //オーバーフローに注意
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;



#define SIZE 55

ll A[SIZE],maxi[SIZE];
ll dp[SIZE][2];

int main(){

	ll N,input_X;
	scanf("%lld %lld",&N,&input_X);

	for(ll i = 0; i < N; i++){

		scanf("%lld",&A[i]);
	}

	maxi[N-1] = HUGE_NUM;
	for(ll i = N-2; i >= 0; i--){

		maxi[i] = A[i+1]/A[i]-1; //使える最大枚数
	}

	stack<ll> S;
	ll X = input_X;

	for(ll i = N-1; i >= 0; i--){

		if(A[i] > X){

			S.push(0);
		}else{

			ll num = X/A[i];
			S.push(num);
			X %= A[i];
		}
	}

	for(ll i = 0; i <= N; i++){
		for(int k = 0; k < 2; k++){

			dp[i][k] = 0;
		}
	}

	dp[0][0] = 1; //dp[見た桁][繰り上がり有無] := 場合の数

	for(ll i = 0; i <= N-1; i++){

		ll x = S.top();
		S.pop();

		for(ll is_up = 0; is_up <= 1; is_up++){
			if(dp[i][is_up] == 0)continue;

			//ルンルンと店員、ともに0
			if(is_up+x == 0 || is_up+x == maxi[i]+1){

				if(is_up+x == 0){

					dp[i+1][0] += dp[i][is_up];

				}else{ //is_up+x == maxi[i]+1 ぴったり繰り上がり

					dp[i+1][1] += dp[i][is_up];
				}
			}

			//ルンルンが0で店員が非0
			if((x+is_up)%(maxi[i]+1) != 0){

				ll num = (maxi[i]+1)-(x+is_up);

				if(num > 0 && num <= maxi[i]){

					dp[i+1][1] += dp[i][is_up];
				}
			}

			//ルンルンが非0で店員が0
			if((x+is_up)%(maxi[i]+1) != 0){

				dp[i+1][0] += dp[i][is_up];
			}
		}
	}

	printf("%lld\n",dp[N][0]);

	return 0;
}

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define sz(x) int(x.size())
#define show(x) {for(auto i: x){cout << i << " ";} cout << endl;}
using namespace std;
using ll = long long;
using P = pair<ll, int>;

map<P, int> mp;
int N;
vector<ll> A(55);

ll solve(ll x, int i) {
    // i以降のコインを使う
    ll res;
    if (i == N - 1) {
        return 1;
    }
    if (mp[P(x, i)] != 0) return mp[P(x, i)];
    ll a = A[i], b = A[i+1];
    if (x % b == 0) {
        res = solve(x, i+1);
        mp[P(x, i)] = res;
        return res; // iは使わない
    }
    ll remain = x % b;
    x -= remain;
    res = solve(x, i+1) + solve(x+b, i+1);
    mp[P(x+remain, i)] = res;
    return res;
}

int main() {
    ll X;
    cin >> N >> X;
    rep(i, N) cin >> A[i];
    ll ans = solve(X, 0);
    cout << ans << '\n';
    return 0;
    // 境界、ll, 0, -, 1i, for s&g, debug
}