#include<bits/stdc++.h>
using namespace std;
#define reg register
typedef long long ll;
#define getchar()(p1==p2&&(p2=(p1=buf)+fread(buf,1,100000,stdin),p1==p2)?EOF:*p1++)
static char buf[100000],*p1=buf,*p2=buf;
inline int read(void){
	reg bool f=false;
	reg char ch=getchar();
	reg int res=0;
	while(!isdigit(ch))f|=(ch=='-'),ch=getchar();
	while(isdigit(ch))res=10*res+(ch^'0'),ch=getchar();
	return f?-res:res;
}
inline ll readll(void){
	reg bool f=false;
	reg char ch=getchar();
	reg ll res=0;
	while(!isdigit(ch))f|=(ch=='-'),ch=getchar();
	while(isdigit(ch))res=10ll*res+(ch^'0'),ch=getchar();
	return f?-res:res;
}

const int MAXN=50+5;

int n;
ll x;
ll a[MAXN];
map<ll,ll> f,g;

int main(void){
	n=read(),x=readll();
	for(reg int i=1;i<=n;++i)
		a[n-i+1]=readll();
	ll x0=x/a[1]*a[1];
	f[x0]=1;
	if(x0!=x)
		f[x0+a[1]]=1;
	for(reg int i=2;i<=n;++i){
		g.clear();
		reg ll Max=a[i-1]/a[i];
		for(auto it:f){
			reg ll d=x-it.first,m=d/a[i];
			ll y=it.first+m*a[i];
			if(abs(m)<Max)
				g[y]+=it.second;
			if(y!=x&&abs(m)+1<Max)
				g[y+a[i]*(d/abs(d))]+=it.second;
		}
		swap(f,g);
	}
	printf("%lld\n",f[x]);
	return 0;
}
/*{{{*/
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<string>
#include<iostream>
#include<sstream>
#include<set>
#include<map>
#include<queue>
#include<bitset>
#include<vector>
#include<limits.h>
#include<assert.h>
#define SZ(X) ((int)(X).size())
#define ALL(X) (X).begin(), (X).end()
#define REP(I, N) for (int I = 0; I < (N); ++I)
#define REPP(I, A, B) for (int I = (A); I < (B); ++I)
#define FOR(I, A, B) for (int I = (A); I <= (B); ++I)
#define FORS(I, S) for (int I = 0; S[I]; ++I)
#define RS(X) scanf("%s", (X))
#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define GET_POS(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
#define CASET int ___T; scanf("%d", &___T); for(int cs=1;cs<=___T;cs++)
#define MP make_pair
#define PB emplace_back
#define MS0(X) memset((X), 0, sizeof((X)))
#define MS1(X) memset((X), -1, sizeof((X)))
#define LEN(X) strlen(X)
#define F first
#define S second
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;
typedef long double LD;
typedef pair<int,int> PII;
typedef vector<int> VI;
typedef vector<LL> VL;
typedef vector<PII> VPII;
typedef pair<LL,LL> PLL;
typedef vector<PLL> VPLL;
template<class T> void _R(T &x) { cin >> x; }
void _R(int &x) { scanf("%d", &x); }
void _R(int64_t &x) { scanf("%lld", &x); }
void _R(double &x) { scanf("%lf", &x); }
void _R(char &x) { scanf(" %c", &x); }
void _R(char *x) { scanf("%s", x); }
void R() {}
template<class T, class... U> void R(T &head, U &... tail) { _R(head); R(tail...); }
template<class T> void _W(const T &x) { cout << x; }
void _W(const int &x) { printf("%d", x); }
void _W(const int64_t &x) { printf("%lld", x); }
void _W(const double &x) { printf("%.16f", x); }
void _W(const char &x) { putchar(x); }
void _W(const char *x) { printf("%s", x); }
template<class T,class U> void _W(const pair<T,U> &x) {_W(x.F); putchar(' '); _W(x.S);}
template<class T> void _W(const vector<T> &x) { for (auto i = x.begin(); i != x.end(); _W(*i++)) if (i != x.cbegin()) putchar(' '); }
void W() {}
template<class T, class... U> void W(const T &head, const U &... tail) { _W(head); putchar(sizeof...(tail) ? ' ' : '\n'); W(tail...); }
#ifdef HOME
 #define DEBUG(...) {printf("[DEBUG] ");W(__VA_ARGS__);}
#else
 #define DEBUG(...)
#endif
int MOD = 1e9+7;
void ADD(LL& x,LL v){x=(x+v)%MOD;if(x<0)x+=MOD;}
/*}}}*/
const int SIZE = 1<<20;
LL N, X;
LL A[SIZE];
LL m[SIZE],v[SIZE];
LL dp[SIZE];
void solve() {
    for(int i=N;i>0;i--){
        v[i]=X/A[i];
        X%=A[i];
    }
    dp[0]=1;
    FOR(i,1,N){
        if(v[i]==m[i]-1){
            for(int j=i-1;j>=0;j--){
                dp[i]+=dp[j];
                if(v[j])break;
            }
            continue;
        }
        bool is_zero=1;
        for(int j=i;j>0;j--){
            if(v[j])is_zero=0;
            if(!is_zero){
                dp[i]+=dp[j-1];
            }
        }
    }
    LL an=0;
    for(int i=N;i>0;i--){
        an+=dp[i];
        if(v[i])break;
    }
    W(an);
}
void input() {
    R(N,X);
    FOR(i,1,N){
        R(A[i]);
        if(i>1)m[i-1]=A[i]/A[i-1];
    }
    m[N]=1e16;
}
int main(){
    input();
    solve();
    return 0;
}
