#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <string.h>
#include <algorithm>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
#include <bits/stdc++.h>
using namespace std;
 
const double TL = 1.5 * CLOCKS_PER_SEC;
mt19937 rng((unsigned int) chrono::steady_clock::now().time_since_epoch().count());
#define clr(x, y) memset(x, y, sizeof(x))
#define forn(i, n) for (int i = 0; i < n; i++)
#define LL long long
const double pi = acos(-1.0);

int n;
LL y, x[100];
map<pair<LL, LL>, LL> mp;

LL dfs(int i, LL y) {
  if (mp.find({i, y}) != mp.end()) {
    return mp[{i, y}];
  }
  LL g = y / x[i];

  if (y % x[i] == 0) {
    if (i == n - 1 || g < x[i + 1] / x[i]) {
      mp[{i, y}] = 1;
    } else {
      mp[{i, y}] = 0;
    }
    return mp[{i, y}];
  } else {
    LL yl = g * x[i];
    LL yr = (g + 1) * x[i];
    LL t = 0;
    if (i == n - 1 || g < x[i + 1] / x[i]) {
      t += dfs(i - 1, abs(y - yl));
    }
    if (i == n - 1 || g + 1 < x[i + 1] / x[i]) {
      t += dfs(i - 1, abs(y - yr));
    }
    mp[{i, y}] = t;
  }
  return mp[{i, y}];
}
int main() {
#ifdef LOCAL
  auto start_clock = clock();
  freopen("in", "r", stdin);
#endif
  scanf("%d", &n);
  cin >> y;
  for (int i = 0; i < n; i++) {
    cin >> x[i];
  }
  LL ans = dfs(n - 1, y);
  cout << ans << endl;

#ifdef LOCAL
 auto end_clock = clock();
 cout << "Time:" << (end_clock - start_clock) * 1.0 / CLOCKS_PER_SEC << endl;
#endif
  return 0;
}
#include <bits/stdc++.h>
 
#define TRACE(x) cerr << #x << " = " << x << endl
#define pb push_back
#define mp make_pair
#define fi first
#define se second
 
#define FOR(i, a, b) for(int i = (a); i < (b); i++)
#define REP(i, n) FOR(i, 0, n)
 
#define SZ(x) (int)(x).size()
 
using namespace std;
 
typedef long long ll;
typedef double lf;
typedef pair<int, int> pii;
typedef vector<int> VI;
 
template<class Num>
Num mabs(Num A){
  if(A < 0) return -A;
  return A;
}
	

int main(){
	int n;
	ll x;
	scanf("%d %lld", &n, &x);
	vector<ll> coin(n);
	REP(i, n)
		scanf("%lld", &coin[i]);

	vector<ll> X(n);
	
	reverse(coin.begin(), coin.end());
	ll tx = x;
	REP(i, n){
		ll ide = x / coin[i];	
		X[i] = ide; 
		x -= ide * coin[i];
	}

	reverse(coin.begin(), coin.end());
	reverse(X.begin(), X.end());
	x = tx;
												
//	cout << "reprezentacija x " << endl;
//	for(ll p : X)
//		cout << p << ' ';
//	cout << endl;

	vector<vector<ll> > ways(n + 2, vector<ll>(2, 0ll));

	ways[n - 1][0] = ways[n - 1][1] = 1;
	for(int i = n - 2; i >= 0; i--){
		if(X[i] == 0){
			ways[i][0] += ways[i + 1][0];
			int pt = i + 1;
			while(pt < n - 1 && coin[pt + 1] / coin[pt] - 1 == X[pt]) pt++;
			ways[i][1] = ways[i][0] + ways[pt][1];
		}
		else{
			ways[i][0] += ways[i + 1][0];
			int pt = i + 1;
			while(pt < n - 1 && coin[pt + 1] / coin[pt] - 1 == X[pt]) pt++;
			ways[i][0] += ways[pt][1];
			ways[i][1] = ways[i][0];
		}
	}
			
	

//	cout << "check " << endl;
//	REP(i, n)
//		cout << ways[i][0] << ' ';
//	cout << endl;
//
	printf("%lld\n", ways[0][0]);

  return 0;
}

