/*One cannot escape the feeling ... that these mathematical formulae have
an independent existence and an intelligence of their own ... that they
are wiser than we are, wiser even than their discoverers ... that we get
more out of them that was originally put into them.
*/

#include<bits/stdc++.h>
using namespace std;
 
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#define pb push_back
#define ll long long
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define rep(i,n) for(i=0;i<n;i++)
#define forn(i, n) for (ll i = 0; i < (ll)(n); ++i)
#define for1(i, n) for (ll i = 1; i <= (ll)(n); ++i)
#define ford(i, n) for (ll i = (ll)(n) - 1; id good if no two adjacent cells contain the same value, where two cells are called adjacent if they share a side. >= 0; --i)
#define fore(i, a, b) for (ll i = (ll)(a); i <= (ll)(b); ++i)
#define fora(it,x) for(auto it:x)
#define PI 3.14159265
#define sync ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define endl "\n"
 
typedef pair<ll, ll> pii;
typedef vector<ll> vi;
typedef vector<pii> vpi;
typedef vector<vi> vvi;
typedef long long i64;
typedef vector<i64> vi64;
typedef vector<vi64> vvi64;
typedef pair<i64, i64> pi64;
typedef long double ld;
 
template<class T> bool uin(T &a, T b) { return a > b ? (a = b, true) : false; }
template<class T> bool uax(T &a, T b) { return a < b ? (a = b, true) : false; }

ll a[52],dp[52],span[52],g[52],possible[52],fact[52];
int main(){
    ll n,x;
    cin>>n>>x;

    forn(i,n) cin>>a[i];
    forn(i,n-1){
        fact[i]=(a[i+1]/a[i])-1;
    }
    fact[n-1]=1e18;
    for(ll i=n-1;i>=0;i--){
        g[i]=x/a[i];
        x%=a[i];
    }
    for(ll i=0;i<n;i++){
        ll c=0;
        for(ll j=i+1;j<n;j++){
            if(g[j]==fact[j]) c++;
            else break;
        }
        span[i]=c;
    }
    possible[n-1]=1;
    dp[n-1]=1;
    for(ll i=n-2;i>=0;i--){
        dp[i]=0;
        ll c=0;
        if(g[i]) c+=possible[i+span[i]+1];
        dp[i]+=dp[i+1];
        dp[i]+=c;
        if(g[i]) possible[i]=dp[i];
        else possible[i]=dp[i+1]+possible[i+1+span[i]];
    }
    cout<<dp[0];
}
// -----------------------------------
// author   : MatsuTaku
// country  : Japan
// created  : 11/08/20 20:48:16
// -----------------------------------

#include <bits/stdc++.h>

using namespace std;
using ll = long long;

int main() {
  cin.tie(nullptr); ios::sync_with_stdio(false);

  int n; cin>>n;
  ll x; cin>>x;
  vector<ll> A(n); for (auto& a:A) cin>>a;
  vector<ll> pa(n);
  for (int i = 0; i < n-1; i++)
    pa[i] = A[i+1]/A[i];
  pa[n-1] = 1e18;

  vector<map<ll, ll>> dp(n+1);
  dp[n][x] = 1;
  for (int i = n-1; i >= 0; i--) {
    for (auto [d, p] : dp[i+1]) {
      auto md = d%A[i];
      ll dist = abs(d/A[i]);
      if (dist < pa[i])
        dp[i][md] += p;
      if (md != 0) {
        if (md > 0) {
          md -= A[i];
          dist += d > 0 ? 1 : -1;
        } else {
          md += A[i];
          dist += d > 0 ? -1 : 1;
        }
        if (dist < pa[i])
          dp[i][md] += p;
      }
    }
  }
  cout << dp[0][0] << endl;

  return 0;
}
