#include<bits/stdc++.h>
using namespace std;

int n;
long long X,cur;
long long a[55],b[55];
long long dp[55][2];

int main(){
	scanf("%d%lld",&n,&X);
	cur=X;
	for(int i=1;i<=n;i++) scanf("%lld",a+i);
	for(int i=1;i<n;i++){
		b[i]=cur%(a[i+1])/a[i];
		cur-=a[i]*b[i];
	}
	dp[0][0]=1ll;
	for(int i=1;i<n;i++){
		dp[i][0]+=dp[i-1][0];
		if(b[i]!=0ll) dp[i][1]+=dp[i-1][0];
		dp[i][1]+=dp[i-1][1];
		if(b[i]+1!=a[i+1]/a[i]) dp[i][0]+=dp[i-1][1];
	}
	printf("%lld\n",dp[n-1][0]+dp[n-1][1]);
	return 0;
}
#include<bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef pair<int,int> P;

#define p_ary(ary,a,b) do { cout << "["; for (int count = (a);count < (b);++count) cout << ary[count] << ((b)-1 == count ? "" : ", "); cout << "]\n"; } while(0)
#define p_map(map,it) do {cout << "{";for (auto (it) = map.begin();;++(it)) {if ((it) == map.end()) {cout << "}\n";break;}else cout << "" << (it)->first << "=>" << (it)->second << ", ";}}while(0)

template<typename T1,typename T2>ostream& operator<<(ostream& os,const pair<T1,T2>& a) {os << "(" << a.first << ", " << a.second << ")";return os;}

const char newl = '\n';

int main() {
    int n;
    ll x;
    cin >> n >> x;
    vector<ll> a(n),b(n);
    for (int i = 0;i < n;++i) cin >> a[i];
    for (int i = n-1;i >= 0;--i) {
        b[i] = x/a[i];
        x %= a[i];
    }
    vector<ll> dp0(n+1,0),dp1(n+1,0);
    dp0[0] = 1;
    for (int i = 0;i < n;++i) {
        dp0[i+1] += dp0[i];
        if (i+1 < n && b[i]+1 == a[i+1]/a[i]) dp1[i+1] += dp1[i];
        else dp0[i+1] += dp1[i];
        if (b[i]) dp1[i+1] += dp0[i];
        if (i == n-1 || b[i]+1 < a[i+1]/a[i]) dp1[i+1] += dp1[i];
    }
    cout << dp0[n] << newl;
    // p_ary(dp0,0,n+1);
    // p_ary(dp1,0,n+1);
}