#include <bits/stdc++.h>
using namespace std;
long long N, A;
int x[50];
map<pair<int,int>, long long> memo;
long long f(int p, int s) {
	if (p == N) return s == 0 ? 1 : 0;
	if (memo.count({p, s})) return memo[{p, s}];
	return memo[{p, s}] = f(p+1, s) + f(p+1, s + x[p]-A);
}
int main() {
	cin >> N >> A;
	for (int i = 0; i < N; ++ i) cin >> x[i];
	cout << f(0, 0) - 1 << endl;
}
