#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define mp make_pair
using namespace std;
int N,A;
ll dp[51][2501],ans;
vector<int> a(N);
int main()
{
	cin>>N>>A;
	for (int& x: a) cin>>x;
	dp[0][0]=1;
	for (int x: a)
	{
		for (int k=50;k>=0;k--)
			for (int y=0;y<=2500;y++)
			{
				if (!dp[k][y]) continue;      //dp[k][y]表示 取其中k张卡片,总和为y的方案数 
				dp[k+1][y+t]+=dp[k][y];
			}
	}	
	for (int k=1;k<=50;k++)
		for (int y=0;y<=2500;y++)
			if (k*A==y) ans+=dp[k][y];
	cout<<ans;
    return 0;
}