#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <queue>
#include <stack>
#include <map>
#include <algorithm>
#include <math.h>
#include <cassert>
#define rep(i,n) for(int i = 0; i < n; ++i )
using namespace std;
using ll = long long;
using P = pair<int,int>;

int main() {
  int n; ll x;
  cin >> n >> x;
  vector<ll> a(n);
  rep(i,n) cin >> a[i];
  reverse(a.begin(),a.end());

  map<ll,ll> dp;
  ll x0 = x/a[0]*a[0];
  dp[x0] = 1;
  if(x0!=x) dp[x0+a[0]] = 1;

  for(int i=1;i<n;++i){
    map<ll,ll> ndp;
    ll mx = a[i-1]/a[i];
    for(auto p:dp){
      ll d = x-p.first;
      ll m = d/a[i];
      ll nx = p.first + m*a[i];
      if(abs(m)<mx) {
        ndp[nx] += p.second;
      }
      if(nx!=x && abs(m)+1<mx) {
        ndp[nx + a[i]*(d/abs(d))] += p.second;
      }
    }
    swap(dp,ndp);
  }
  cout << dp[x] << endl;
}

#include <bits/stdc++.h>
using namespace std;

#define rep(i, a, b) for (int i = (a), i##end = (b); i <= i##end; ++i)
#define per(i, a, b) for (int i = (a), i##end = (b); i >= i##end; --i)

namespace IO {
	const int MAXIOSIZE = 1 << 24 | 1;
	unsigned char buf[MAXIOSIZE], *p1, *p2;
	#define gc (p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 1 << 24, stdin), p1 == p2) ? EOF : *p1++)
	template <typename T> void read(T& x) {
		x = 0; char ch = gc; bool flg = false;
		for (; ch < '0' || '9' < ch; ch = gc) if (ch == '-') flg |= true;
		for (; '0' <= ch && ch <= '9'; ch = gc) x = x * 10 + ch - '0';
		flg ? x = -x : 0;
	}
	template <typename T> void out(const T& x) { if (x > 9) out(x / 10); putchar(x % 10 + '0'); }
	template <typename T> inline void write(const T& x, const char& ed) { if (x < 0) putchar('-'), out(-x); else out(x); putchar(ed); }
}


typedef long long ll;

const int MAXN = 50 + 10;

int n;
ll x, X[MAXN], a[MAXN], A[MAXN], f[MAXN][2];

int main() {
	IO::read(n); IO::read(x);
	a[0] = 1;
	rep(i, 1, n) IO::read(a[i]), A[i - 1] = (a[i] / a[i - 1]) - 1;
	A[n] = LONG_LONG_MAX;
	ll x_copy = x;
	per(i, n, 1) {
		if (!x_copy) break;
		if (x_copy >= a[i]) X[i] = x_copy / a[i], x_copy %= a[i];
	}
	f[0][0] = 1;
	rep(i, 0, n - 1) {
		rep(carry, 0, 1) {
			ll& slf = f[i][carry];
			ll nxt = X[i + 1] + carry; bool carry_tag = false;
			if (nxt > A[i + 1]) carry_tag = true;
			f[i + 1][carry_tag] += slf;
			nxt = A[i + 1] + 1 - carry - X[i + 1];
			if (nxt > 0 && nxt <= A[i + 1]) f[i + 1][true] += slf;
		}
	}
	IO::write(f[n][false], '\n');
	return 0;
}
