#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
typedef vector<ll> vl;
typedef vector<bool> vb;
typedef vector<string> vs;
typedef vector<char> vc;
typedef queue<ll> ql;
typedef deque<ll> dql;
typedef priority_queue<ll> pql;
typedef set<ll> sl;
typedef pair<ll, ll> pl;
typedef vector<vl> vvl;
typedef vector<pl> vpl;
#define rep(i, n) for(ll i = 0; i < ll(n); i++)
#define rep2(i, k, n) for(ll i = ll(k); i <= ll(n); i++)
#define rep3(i, n, k) for(ll i = ll(n); i >= ll(k); i--)
#define all(v) (v).begin(), (v).end()
ll mod(ll a, ll b) {if(b == 0) return 0; return (a % b + b) % b;}
bool chmin(ll &a, ll b) {if(b < a) {a = b; return 1;} return 0;}
bool chmax(ll &a, ll b) {if(b > a) {a = b; return 1;} return 0;}
const ll INF = 1LL << 60;
const ll MOD = 1e9 + 7;
//const ll MOD = 998244353;
const ll MAX = 2e5;
const ld eps = 1e-9;
const char newl = '\n';

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

  ll n, x;
  cin >> n >> x;
  vl a(n);
  rep3(i, n-1, 0) cin >> a[i];

  map<ll, ll> dp[n+1];
  dp[0][x] = 1;
  rep(i, n) for(pl p: dp[i]) {
      ll d = p.first - a[i]*(p.first/a[i]);
      dp[i+1][d] += p.second;
      if(i==0 || abs(p.first) + a[i] < a[i-1]) {
        if(d>0) dp[i+1][d-a[i]] += p.second;
        if(d<0) dp[i+1][d+a[i]] += p.second;
      }
  }
  cout << dp[n][0] << newl;
  return 0;
}
#include <bits/stdc++.h>
using namespace std;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  long long x;
  cin >> n >> x;
  vector<long long> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  vector<long long> b(n);
  for (int i = n - 1; i >= 0; i--) {
    b[i] = x / a[i];
    x %= a[i];
  }
  vector<int> next(n - 1);
  for (int i = 0; i < n - 1; i++) {
    next[i] = n - 1;
    for (int j = i + 1; j < n - 1; j++) {
      if (b[j] != a[j + 1] / a[j] - 1) {
        next[i] = j;
        break;
      }
    }
  }
  vector<long long> dp(n - 1, 0);
  for (int i = 0; i < n - 1; i++) {
    if (b[i] > 0) {
      dp[i] = 1;
      for (int j = i - 2; j >= 0; j--) {
        if (i > next[j]) {
          dp[i] += dp[j];
        }
      }
    }
    if (b[i] != a[i + 1] / a[i] - 1 && i > 0) {
      for (int j = 0; j < i; j++) {
        if (next[j] == i) {
          dp[i] += dp[j];
        }
      }
    }
  }
  cout << accumulate(dp.begin(), dp.end(), 0ll) + 1 << '\n';
  return 0;  
}