// Author : Sarthak Kapoor
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
#define int ll
#define rep(i,n) for(int i=0;i<n;++i)
#define repa(i,a,n) for(int i=a;i<n;++i)
#define repr(i,n) for(int i=n-1;i>=0;--i)
#define ll long long
#define pi pair<int,int> 
#define pii pair<pi,int>
#define vi vector<int>
#define pb push_back 
#define fi first
#define sec second
#define all(v) v.begin(),v.end()
#define s(v) v.size()
ll mod = 1000000007;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());//use rng()%n for numbers in range [0,n-1]
ll gcd(ll a,ll b){
	if(b==0)return a;
	return gcd(b,a%b);
}
ll fastexp(ll x,ll a){
    ll res = 1;
    while(a>0){
        if(a&1){
            res = (res*x)%mod;
        }
        a=a>>1;
        x=(x*x)%mod;
    }
    return res;
}
ll inverse(ll n){
    return fastexp(n,mod-2);
}
template <typename T>
void add(T &a, T b){
	a += b;
	if(a >= mod)a -= mod;
}
template <typename T>
void sub(T &a, T b){
	a -= b;
	if(a < 0)a += mod;
}
template <typename T>
void mul(T &a, T b){
	a *= b;
	if(a >= mod)a %= mod;
}
signed main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	int n,x;
	cin>>n>>x;
	vi v(n);
	rep(i,n){
		cin>>v[i];
	}
	map<int,int> mp;
	mp[x] = 1;
	rep(i,n-1){
		map<int,int> newmp;
		for(auto x:mp){
			// x.fi ke sabse pass vaale 2 numbers which
			// are divisible by v[i+1] (might be 1)
			int num = x.fi;
			int r = num%v[i+1];
			if(r == 0){
				newmp[num] += x.sec;
			}
			else{
				newmp[num-r] += x.sec;
				newmp[num+v[i+1]-r] += x.sec;
			}
		}
		mp = newmp;
	}
	int ans = 0;
	for(auto x:mp){
		ans += x.sec;
	}
	cout<<ans;
	return 0;
}
#include <iostream>
#include <stdio.h>
#include <algorithm>

using namespace std;

long long a[105],l,k,n,m,f[105][2],c[105],b[105];

int main()
{
	scanf("%lld%lld",&n,&m);
	for (int i=1;i<=n;i++)
	 scanf("%lld",&a[i]);
	sort(a+1,a+1+n);l=m;
	for (int i=n;i>=1;i--)
	 {
	 	b[i]=l/a[i];
	 	l=l%a[i];
	 }
	for (int i=1;i<n;i++)
	 c[i]=a[i+1]/a[i];
	
	f[0][0]=1;
	for (int i=1;i<=n;i++)
	 {
	 	if (b[i]==c[i]-1) {f[i][1]=f[i-1][1]+f[i-1][0];f[i][0]=f[i-1][0];}
	 	 else if (b[i]==0) {f[i][1]=f[i-1][1];f[i][0]=f[i-1][0]+f[i-1][1];}
	 	  else {f[i][1]=f[i-1][0]+f[i-1][1];f[i][0]=f[i-1][1]+f[i-1][0];}
	 }
	cout<<f[n][0];
	return 0;
}