#include<cstdio>
#include<algorithm>
#include<iostream>
using namespace std;
typedef long long ll;
int n, a,noww;
ll dp[51][2501];
int main()
{
	dp[0][0]=1;
	scanf_s("%d%d", &n, &a);
	int x;
	for (int i = 1; i <= n; i++) {
		scanf_s("%d", &x);
		noww += x;
		for (int j = i; j >= 1; j--) {
			for (int t = noww; t>=x; t--) {
				dp[j][t] += dp[j-1][t-x];
			}
		}
	}
	ll ans = 0;
	for (int i = 1; i <= n; i++)
		ans += dp[i][i * a];
	printf("%lld\n", ans);
	return 0;
}