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

long long dp[55][2505], ans;
int n, a, m;
int main() {
	scanf("%d%d", &n, &a); 
	dp[0][0] = 1; 
	m = a * n;
	for (int t, i = 1; i <= n; i++) {
		scanf("%d", &t);
		for (int j = i; j; --j)
			for (int k = m; k >= t; --k)
				dp[j][k] += dp[j-1][k-t];
	} 
	for (int i = 1; i <= n; ++i) ans += dp[i][i*a];
	printf("%lld\n", ans);
	return 0;
}