#include<bits/stdc++.h>
using namespace std;
using ll = long long;

ll dp[61][61][5501];//i個目までの選択肢でｊ個を選んで合計がｋの個数
int main()
{
	int n,a;
	cin >> n >> a;
	vector<ll>x(n);for(int i =0;i<n;i++)cin >> x[i];
	dp[0][0][0] = 1;
	for(int i = 0;i<n;i++)
	{
		for(int j = 0;j<n;j++)
		{
			for(int k = 0;k<2501;k++)
			{
				if(dp[i][j][k])
				{
					dp[i+1][j][k] += dp[i][j][k];
					dp[i+1][j+1][k+x[i]] += dp[i][j][k];
				}
			}
		}
	}
	ll cnt =0;

	for(int i = 1;i*a<=(2500)&&i<=60;i++)
	{
		cnt += dp[n][i][a*i];
	}

	cout << cnt << endl;
}
