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

const int N = 55;
const int offset = N * N;

int n, A, a[N];
long long f[N][offset + offset];

int main() {
	ios_base::sync_with_stdio(false); cin.tie(0);
	cin >> n >> A;
	for (int i = 1; i <= n; ++i) cin >> a[i], a[i] -= A;

	f[0][offset] = 1;
	for (int i = 1; i <= n; ++i) {
		for (int j = 0; j < offset + offset; ++j) {
			f[i][j] = f[i-1][j];
			if (j - a[i] >= 0 && j - a[i] < offset + offset) {
				f[i][j] += f[i-1][j - a[i]];
			} 
		}
	}

	cout << f[n][offset] - 1 << endl;
}