#include <iostream>
#include <string>
#include <algorithm>
#include <cstdio>
#include <vector>
#include <queue>
#include <set>
#include <numeric>
#include <cmath>

using namespace std;

typedef long long int ll;

#define all(x) x.begin(),x.end()

const ll mod = 1e9+7;
const ll INF = 1e9;
const ll MAXN = 1e9;

int main()
{
	ll n,a;
	cin >> n >> a;
	vector<ll>x(n+1);
	for(int i = 1; i <= n; i++){
		cin >> x[i];
	}

	ll dp[51][51][50*50+1] = {0};

	for(int i = 0; i <= n; i++){
		dp[i][0][0]=1;
	}

	for(int i = 1; i <= n; i++){
		for(int j = 1; j <= n; j++){
			for(int k = 0; k <=; k++){
				if(k-x[i] >= 0){
					dp[i][j][k] = dp[i-1][j-1][k-x[i]] + dp[i-1][j][k];
				}else{
					dp[i][j][k] = dp[i-1][j][k];
				}
			}
		}
	}


	ll ans = 0;

	for(int j = 1; j <= n; j++){
		//cout << ans << endl;
		ans += dp[n][j][j*a];
	}

	cout << ans << endl;

	return 0;
}