#include<iostream>
#include<cstring>
using namespace std;
#define ll long long
ll dp[2500][50];
ll a[50];
; int main()
{
	int n, ave;
	cin >> n >> ave;
	for (int i = 0; i < n; i++)
		cin >> a[i];
	memset(dp, 0, sizeof(dp));
	dp[0][0] = 1;
	for (int i = 0; i < n; i++)
		for (int j = n * 50; j >= a[i]; j--)
			for (int k = 1; k <= n; k++)
				if (dp[j - a[i]][k - 1])
					dp[j][k] += dp[j - a[i]][k - 1];
	ll ans = 0;
	for (int i = 1; i <= n; i++)
		ans += dp[i * ave][i];
	cout << ans << endl;
	return 0;
}