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

int main() {
	int N, A, X[50], x, MAX;
	static long long DP[60][5000] = {};
	cin >> N >> A;
	MAX = A;
	for (int i = 0; i < N; i++) {
		cin >> x;
		X[i] = x - A;
		MAX = max(MAX, abs(X[i]));
	}
	DP[0][N * MAX] = 1;
	for (int i = 0; i < N; i++) {
		for (int j = 0; j <= 2 * N * MAX; j++) {
			if (j - X[i] < 0 || j - X[i] > 2 * N * MAX) DP[i + 1][j] = DP[i][j];
			else DP[i + 1][j] = DP[i][j] + DP[i][j - X[i]];
		}
	}
	cout << DP[N][N * MAX] - 1;
}