#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 50 + 5;
const int maxm = 2500 + 10;
int a[maxn];
ll f[maxm << 1];
int main()
{
	int n, x;
	scanf("%d%d", &n, &x);
	for(int i = 1; i <= n; ++i)
	{
		scanf("%d", &a[i]);
		a[i] -= x;
	}
	f[maxm] = 1;
	for(int i = 1; i <= n; ++i)
		if(a[i] >= 0)
		{
			for(int j = (maxm << 1) - 1; j >= a[i]; --j)
				f[j] += f[j - a[i]];
		}
		else
		{
			for(int j = 0; j < (maxm << 1) + a[i]; ++j)
				f[j] += f[j - a[i]];
		}
	cout << f[maxm] - 1 << endl;
	return 0;
}