// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;



using VS = vector<string>;    using LL = long long;

using VI = vector<int>;       using VVI = vector<VI>;

using PII = pair<int, int>;   using PLL = pair<LL, LL>;

using VL = vector<LL>;        using VVL = vector<VL>;



#define ALL(a)  begin((a)),end((a))

#define RALL(a) (a).rbegin(), (a).rend()

#define SZ(a) int((a).size())

#define SORT(c) sort(ALL((c)))

#define RSORT(c) sort(RALL((c)))

#define UNIQ(c) (c).erase(unique(ALL((c))), end((c)))

#define FOR(i, s, e) for (int(i) = (s); (i) < (e); (i)++)

#define FORR(i, s, e) for (int(i) = (s); (i) > (e); (i)--)

//#pragma GCC optimize ("-O3") 

#ifdef YANG33

#include "mydebug.hpp"

#else

#define DD(x) 

#endif

const int INF = 1e9;                          const LL LINF = 1e16;

const LL MOD = 1000000007;                    const double PI = acos(-1.0);

int DX[8] = { 0, 0, 1, -1, 1, 1, -1, -1 };    int DY[8] = { 1, -1, 0, 0, 1, -1, 1, -1 };



/* -----  __MAKE_TIME__  Problem: __PROBLEM__ / Link: __CONTEST_URL__  ----- */

/* ------問題------







-----問題ここまで----- */

/* -----解説等-----







----解説ここまで---- */





LL dp[52][52][52 * 52];

int main() {

	cin.tie(0);

	ios_base::sync_with_stdio(false);



	LL N, A; cin >> N >> A;

	// i枚選択して合計A*iになっていれば平均はA

	dp[0][0][0] = 1;

	FOR(i, 0, N) {

		LL a; cin >> a;

		FOR(k, 0, N) {

			FOR(pa, 0, 2500 - a + 1) {

				dp[i + 1][k][pa] += dp[i][k][pa];

				dp[i + 1][k + 1][pa + a] += dp[i][k][pa];

			}

		}

	}

	LL ans = 0;

	FOR(i, 1, N + 1) {

		ans += dp[N][i][i*A];

	}

	cout << ans << endl;





	return 0;

}


// Faster C++ solution for the same problem (measured speedup: 1.6362656242120501x):
#include <bits/stdc++.h>

using namespace std;



using VS = vector<string>;    using LL = long long;

using VI = vector<int>;       using VVI = vector<VI>;

using PII = pair<int, int>;   using PLL = pair<LL, LL>;

using VL = vector<LL>;        using VVL = vector<VL>;



#define ALL(a)  begin((a)),end((a))

#define RALL(a) (a).rbegin(), (a).rend()

#define SZ(a) int((a).size())

#define SORT(c) sort(ALL((c)))

#define RSORT(c) sort(RALL((c)))

#define UNIQ(c) (c).erase(unique(ALL((c))), end((c)))

#define FOR(i, s, e) for (int(i) = (s); (i) < (e); (i)++)

#define FORR(i, s, e) for (int(i) = (s); (i) > (e); (i)--)

//#pragma GCC optimize ("-O3") 

#ifdef YANG33

#include "mydebug.hpp"

#else

#define DD(x) 

#endif

const int INF = 1e9;                          const LL LINF = 1e16;

const LL MOD = 1000000007;                    const double PI = acos(-1.0);

int DX[8] = { 0, 0, 1, -1, 1, 1, -1, -1 };    int DY[8] = { 1, -1, 0, 0, 1, -1, 1, -1 };



/* -----  __MAKE_TIME__  Problem: __PROBLEM__ / Link: __CONTEST_URL__  ----- */

/* ------問題------







-----問題ここまで----- */

/* -----解説等-----







----解説ここまで---- */



LL ans = 0LL;



int main() {

	cin.tie(0);

	ios_base::sync_with_stdio(false);



	LL N, A; cin >> N >> A;

	VL x(N);

	FOR(i, 0, N) {

		cin >> x[i];

		x[i] -= A;

	}



	map<int, LL>dp;

	dp[0] = 1;

	FOR(i, 0, N) {

		map<int, LL>nx;

		for (auto it : dp) {

			nx[it.first + x[i]] += it.second;

			nx[it.first] += it.second;

		}



		nx.swap(dp);

	}



	ans = dp[0]-1;



	cout << ans << "\n";



	return 0;

}