#include <algorithm>
#include <bitset>
#include <chrono>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <vector>

#define INF 0x3f3f3f3f
#define MOD 1000000007

using namespace std;
typedef long long ll;

mt19937 rng(random_device{}());
mt19937_64 rng64(random_device{}());

template <typename T> void read(T &x) {
  x = 0;
  char c = getchar();
  T sig = 1;
  for (; !isdigit(c); c = getchar())
    if (c == '-')
      sig = -1;
  for (; isdigit(c); c = getchar())
    x = (x << 3) + (x << 1) + c - '0';
  x *= sig;
}

class Solution {
public:
  void solve() {
    int n;
    ll x;
    read(n);
    read(x);
    vector<ll> a(n);
    for (int i = 0; i < n; ++i)
      read(a[i]);
    unordered_map<ll, ll> v;
    v[x] = 1;
    ll ans = 0;
    for (int i = 0; i < n; ++i) {
      unordered_map<ll, ll> nv;
      for (auto [c, f] : v) {
        if (c == 0)
          continue;
        if (i + 1 < n) {
          ll rem = c % a[i + 1];
          nv[c - rem] += f;
          if (rem > 0)
            nv[c + a[i + 1] - rem] += f;
        } else {
          if (c % a[i] == 0)
            nv[0] += f;
        }
      }
      v = move(nv);
      ans += v[0];
      v.erase(0);
    }
    cout << ans;
  }
};

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  Solution solution = Solution();
  solution.solve();
}
#include <bits/stdc++.h>
using namespace std;

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;

#define pb                    push_back
#define ll                    long long
#define ld                    long double
#define sz(x)                 (ll)x.size()
#define vll                   vector<long long>

#define infi                  INT_MAX
#define infl                  LONG_LONG_MAX
#define infd                  LDBL_MAX
#define f(i,a,b)              for(ll i=a;i<b;i++)
#define fi(i,a,b)             for(ll i=(b-1);i>=a;i--)
#define F                     first
#define S                     second
#define G(a,b)                get<a>(b)
#define MP                    make_pair
#define MT                    make_tuple
#define pll                   pair<ll,ll>
#define endl                  "\n"
#define ALL(v)                v.begin(),v.end()
#define nl                    cout<<"\n";
#define pr(x)                 cout<<x;
#define pr1(x)                cout<<x<<" ";
#define pr2(x,y)              cout<<x<<" "<<y;
#define pr3(x,y,z)            cout<<x<<" "<<y<<" "<<z;
#define pr4(x,y,z,w)          cout<<x<<" "<<y<<" "<<z<<" "<<w;
#define deb                   cout<<"***************************************************************************************\n";
#define moshi                 cout<<"moshi moshi ! \n";
#define hi                    cout<<"hi ! \n";
#define bye                   cout<<"bye bye ! \n";
#define kawai                 cout<<"O kawai koto ! \n";
#define o_set                 tree<ll, null_type,less<ll>, rb_tree_tag,tree_order_statistics_node_update>
#define number_of_set_bits  __builtin_popcountll
#define eb                    emplace_back
const ld PI=3.1415926535897932384626433;


auto clk=clock();
mt19937_64 rng(chrono::high_resolution_clock::now().time_since_epoch().count());

#define TRACE
#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
    template <typename Arg1>
    void __f(const char* name, Arg1&& arg1){
        cout << name << " : " << arg1 <<"\n";
        //use cerr if u want to display at the bottom
    }
    template <typename Arg1, typename... Args>
    void __f(const char* names, Arg1&& arg1, Args&&... args){
        const char* comma = strchr(names + 1, ','); cout.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
    }
#else
#define trace(...)
#endif


//**********************************************************  Code begins  ***********************************************

const ll N=55;
ll n,x,arr[N],cnt[N],dp[N][2],g[N];

void solve()
{
  cin>>n>>x;
  f(i,0,n) cin>>arr[i];
  ll curr=x;
  fi(i,0,n)
  {
  	if(curr==0) break;
  	ll y=curr/arr[i];
  	cnt[i]=y;
  	curr-=(y*arr[i]);
  }
  g[n-1]=infl;
  f(i,0,n-1) g[i]=arr[i+1]/arr[i];
  dp[n-1][0]=dp[n-1][1]=1;  //do nothing
  fi(i,0,n-1)
  {
  	f(j,0,2)
  	{
      curr=cnt[i]+j;
      if(curr==0) 
      {
      	dp[i][j]=dp[i+1][j];
      	continue;
      }
      if(curr==g[i]) dp[i][j]=dp[i+1][1];
      else dp[i][j]=dp[i+1][0]+dp[i+1][1];
  	}
  }
  cout<<dp[0][0]<<"\n";
}
     

int main()
{
    ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
    srand(chrono::high_resolution_clock::now().time_since_epoch().count());
    cout<<fixed<<setprecision(8);
    
    ll test_cases=1;
    //cin>>test_cases;

    f(i,1,test_cases+1)  solve();

    #ifdef rd
    cout<<endl<<endl<<endl<<endl<<"Time elapsed: "<<(double)(clock()-clk)/CLOCKS_PER_SEC<<endl;
    #endif

    return 0;
}
