#include<bits/stdc++.h>
typedef long long ll;

ll x[50], dp[51][51][2501];

int main() {
	ll n, a; scanf("%lld%lld", &n, &a);
	for (int i = 0; i < n; i++)scanf("%lld", &x[i]);
	dp[0][0][0] = 1;
	for (int i = 1; i <= n; i++) {
		for (int j = 0; j <= n; j++) {
			for (int k = 0; k <= 2500; k++) {
				dp[i][j][k] += dp[i - 1][j][k];
				if (j >= 1 && k >= x[i - 1])
					dp[i][j][k] += dp[i - 1][j - 1][k - x[i - 1]];
			}
		}
	}
	ll sum = 0;
	for (int i = 1; i <= n; i++)sum += dp[n][i][a*i];
	printf("%lld\n", sum);
}