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

using ll = long long;
using pii = pair<int, int>;
template <class T>
using V = vector<T>;
template <class T>
using VV = V<V<T>>;

#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fi first
#define se second
#define rep(i, n) rep2(i, 0, n)
#define rep2(i, m, n) for (int i = m; i < (n); i++)
#define per(i, b) per2(i, 0, b)
#define per2(i, a, b) for (int i = int(b) - 1; i >= int(a); i--)
#define ALL(c) (c).begin(), (c).end()
#define SZ(x) ((int)(x).size())

constexpr ll TEN(int n) { return (n == 0) ? 1 : 10 * TEN(n - 1); }

template <class T, class U>
void chmin(T &t, const U &u) {
    if (t > u) t = u;
}
template <class T, class U>
void chmax(T &t, const U &u) {
    if (t < u) t = u;
}

template <class T, class U>
ostream &operator<<(ostream &os, const pair<T, U> &p) {
    os << "(" << p.first << "," << p.second << ")";
    return os;
}

template <class T>
ostream &operator<<(ostream &os, const vector<T> &v) {
    os << "{";
    rep(i, v.size()) {
        if (i) os << ",";
        os << v[i];
    }
    os << "}";
    return os;
}

#ifdef LOCAL
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
    cerr << " " << H;
    debug_out(T...);
}
#define debug(...) \
    cerr << __LINE__ << " [" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#define dump(x) cerr << __LINE__ << " " << #x << " = " << (x) << endl
#else
#define debug(...) (void(0))
#define dump(x) (void(0))
#endif

const int maxn = 52;

map<ll, ll> dp[maxn];

// [-ti,ti]

const ll INF = TEN(16);

int main() {
    int N;
    ll X;
    cin >> N >> X;
    V<ll> A(N);
    rep(i, N) cin >> A[i];
    reverse(ALL(A));

    dp[0][X] = 1;

    rep(i, N) {
        ll bd = i > 0 ? A[i - 1] / A[i] : INF;
        for (auto &[x, num] : dp[i]) {
            ll k = x / A[i];
            for (ll c : {k - 1, k, k + 1}) {
                if (abs(c) >= bd) continue;
                ll rem = x - A[i] * c;
                if (abs(rem) >= A[i]) continue;
                dp[i + 1][rem] += num;
            }
        }
    }

    cout << dp[N][0] << endl;

    return 0;
}
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int N;
vector<ll> hoge;
vector<ll> piyo;
ll memo[100][2];
bool visited[100][2];
ll f(int p, int q) {
	if (visited[p][q]) return memo[p][q];
	visited[p][q] = true;
	if (hoge[p] == -1) {
		if (q == 0) return memo[p][q] = 1;
		else return memo[p][q] = N-p;
	} else {
		ll r = 0;
		if (piyo[p] == 0) {
			r = N-p;
		} else {
			if (hoge[p]+q != piyo[p]) r += f(p+1, 0);
			if (hoge[p]+q != 0) r += f(p+1, 1);
		}
		return memo[p][q] = r;
	}
}
int main() {
	ll X;
	cin >> N >> X;
	vector<ll> A(N);
	for (auto& x : A) cin >> x;
	hoge.resize(N+1);
	piyo.resize(N+1);
	for (int i = N-1; i >= 0; -- i) {
		hoge[i] = X / A[i];
		X %= A[i];
	}
	for (int i = N; i >= 0; -- i) {
		if (hoge[i]) break;
		hoge[i] = -1;
	}
	for (int i = 1; i < N; ++ i) {
		piyo[i-1] = A[i] / A[i-1];
	}
	cout << f(0, 0) << endl;
}
