#include<bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define forn(i,a,b) for(int i =a;i<b;i++)
#define fi first
#define se second
#define fast ios_base::sync_with_stdio(false);
using namespace std;

//for debugging 
/*
g++ -D_GLIBCXX_ASSERTIONS -DDEBUG -ggdb3 -std=c++14 
*/
int recur_depth = 0;
#ifdef DEBUG
#define dbg(x) {++recur_depth; auto x_=x; --recur_depth; cerr<<string(recur_depth, '\t')<<"\e[91m"<<__func__<<":"<<__LINE__<<"\t"<<#x<<" = "<<x_<<"\e[39m"<<endl;}
#else
#define dbg(x)
#endif
template<typename Ostream, typename Cont>
typename enable_if<is_same<Ostream,ostream>::value, Ostream&>::type operator<<(Ostream& os,  const Cont& v){
	os<<"[";
	for(auto& x:v){os<<x<<", ";}
	return os<<"]";
}
template<typename Ostream, typename ...Ts>
Ostream& operator<<(Ostream& os,  const pair<Ts...>& p){
	return os<<"{"<<p.first<<", "<<p.second<<"}";
}
// debugging ends here

typedef long long int ll;
typedef vector<int> vi;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

const int mod = 1e9 + 7;

void addSelf(int &a, int b) {
	a = (a+b)%mod;	
}

void mulSelf(int &a , int b) {
	a = (long long )a*b%mod;
}

int binpow(int a, int b) {
	int res  =1;
	while(b>0) {
		if(b&1) {
			mulSelf(res,a);
		}
		mulSelf(a,a);
		b>>=1;
	}
	return res;
}

const ll mxn = 100;
ll cache[mxn][2];
ll vis[mxn][2];
vector<ll> base(mxn,0);
vector<ll> lim(mxn,0);
ll n;

ll dp(ll i ,ll carry) {
	if(vis[i][carry])
		return cache[i][carry];

	vis[i][carry] = 1;

	if(i == n-1) {
		cache[i][carry] = 1;
		return cache[i][carry];
	}

	cache[i][carry] = 0;
	ll val = lim[i] + carry;

	if(val == 2) { // you will shift the carry further
		cache[i][carry] = dp(i+1,carry);
	} else {
		// i can shift the carry futher only if it is none zero
		cache[i][carry] = dp(i+1,0);

		if(base[i] + carry !=0) {
			cache[i][carry] += dp(i+1,1);
		}
	}

	return cache[i][carry];
}


void solve() {
	ll x;
	cin >> n >> x;
	ll a[n];
	for(ll i =0;i<n;i++)
		cin >> a[i];
	ll cpy = x;
	for(ll i = n-1;~i;--i) {
		if(cpy>=a[i]) {
			base[i] = cpy/a[i];
			cpy%=a[i];
			if(i!=n-1) {
				if(base[i]==(a[i+1]/a[i]) - 1)
					lim[i] = 1;
			}
		}
	}

	cout << dp(0,0) << endl;

}


int main(){
	fast;
	#ifndef ONLINE_JUDGE
		freopen("input.txt","r",stdin);
		freopen("output.txt","w",stdout);
	#endif

	// ll t;cin >> t;while(t--)
		solve();
}

#include<bits/stdc++.h>
long long n,x;
long long ans[2],k[2],a,b,c,now;
int main() 
{
	scanf("%lld%lld",&n,&x);
	scanf("%lld",&b);
	ans[0]=1;ans[1]=0;
	for(int i=1;i<n;++i) 
	{
		scanf("%lld",&a);
		c=a/b;b=a;
		now=x%c;
		x/=c;
		k[0]=ans[0],k[1]=ans[1];
		if(now)k[1]+=ans[0];
		if(++now!=c)k[0]+=ans[1];
		ans[0]=k[0];ans[1]=k[1];
	}
	printf("%lld",ans[0]+ans[1]);
	return 0;	  
} 