//#include "bits/stdc++.h"

#define _USE_MATH_DEFINES

#include <iostream>
#include <sstream>
#include <iomanip>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <numeric>
#include <functional>
#include <utility>
#include <tuple>
#include <vector>
#include <string>
#include <list>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <queue>
#include <deque>
#include <stack>
#include <iterator>
#include <bitset>
#include <complex>
#include <limits>
#include <random>
#include<fstream>
#include<array>
#include<assert.h>


using namespace std;

#define rep(i,a,b) for(int i=(a), i##_len=(b);i<i##_len;i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define all(c) begin(c),end(c)

#define int ll
#define SZ(x) ((int)(x).size())
#define pb push_back
#define mp make_pair

typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ll, int> pli;
typedef pair<double, double> pdd;
typedef vector< vector<int> > mat;

template<class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return true; } return false; }
template<class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return true; } return false; }

const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)1e9 + 7;

const double EPS = 1e-9;

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

	int N;
	cin >> N;

	int X;
	cin >> X;

	vector<int> A(N);
	rep(i, 0, N)
	{
		cin >> A[i];
	}

	if (A[0] > X || X % A[0] != 0)
	{
		cout << 0 << endl;
		return 0;
	}
	X /= A[0];
	rrep(i, 0, N)
	{
		A[i] /= A[0];
	}
	A.push_back(INF);

	map<int, int> DP;
	DP[X] = 1;
	rrep(i, 0, N)
	{
		int t = A[i + 1] / A[i] - 1;
		map<int, int> NDP;
		for (const auto& p : DP)
		{
			if (abs(p.first) < A[i])
			{
				NDP[p.first] += p.second;
			}
			int d = p.first - A[i];
			int cnt = 0;
			if (d > 0)
			{
				cnt += d / A[i];
				d = d - d / A[i] * A[i];
			}
			while (cnt < t&&abs(d) < A[i])
			{
				NDP[d] += p.second;
				d -= A[i];
				cnt++;
			}
			d = p.first + A[i];
			cnt = 0;
			if (d < 0)
			{
				cnt += (-d) / A[i];
				d = d + (-d) / A[i] * A[i];
			}
			while (cnt<t&&abs(d) < A[i])
			{
				NDP[d] += p.second;
				d += A[i];
				cnt++;
			}
		}
		DP = NDP;
	}

	cout << DP[0] << endl;

	return 0;
}

#include <bits/stdc++.h>
using namespace std;
vector<long>p(60);map<pair<long,int>,long> m;long n,x;
long z(long a,int i) {
    if (i == n)return 1;
    if (m.count({a, i}))return m[{a, i}];
    long r, y = p[i], b = a-a%y;
    if (a % y == 0)r = z(a, i + 1);
    else if (a > 0)r = z(b, i + 1) + z(b + y, i + 1);
    else r = z(b, i + 1) + z(b - y, i + 1);
    return m[{a, i}] = r;
}
int main() {
    cin >> n >> x;
    for (int i = 0; i < n; i++)cin >> p[i];
    cout << z(x, 1);
}