#include<iostream>
#include<fstream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<vector>
#include<deque>
#include<set>
#include<map>
#include<bitset>
#include<ctime>
#include<queue>
using namespace std;
#define ll long long
#define int ll
#define ld long double
#define mn 55
#define pi 3.1415926535897
#define inf 6969696969696969696
#define mod (ll)1000000009
#define base 31
#define FLN "TEST"
#define pii pair <int, int>
#define one first
#define two second
#define all(n) n.begin(),n.end()

int n,a;
int s[mn],dp[mn][5005][mn];

void input()
{
	cin>>n>>a;
	for (int i=1; i<=n; i++)
	{
		cin>>s[i];
		s[i]-=a;
	}
	return;
}

int DP(int x, int y, int z)
{
	if (x==0)
	{
		if (y==2500 && z!=0) return 1;
		return 0;
	}
	if (dp[x][y][z]!=inf) return dp[x][y][z];
	return dp[x][y][z]=DP(x-1,y,z) + DP(x-1,y+s[x],z+1); 
}

void output()
{
	cout<<DP(n,2500,0);
	return;
}

void ezclap()
{
	for (int i=0; i<=n; i++)
	{
		for (int j=0; j<=5000; j++)
		{
			for (int k=0; k<=n; k++)
			{
				dp[i][j][k]=inf;
			}
		}
	}
}

signed main()
{
#ifdef Checker
	freopen(FLN".inp", "r", stdin);
	freopen(FLN".out", "w", stdout);
#endif
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
//	int tt;
//	cin>>tt;
//	for (int i=1; i<=tt; i++)
	{
		input();
		ezclap();
		output();
	}
	return 0;
}

