#include <iostream>
using namespace std;
const int N = 50;
const int X = 50;
int Y[N];

long long solve(int n, int a){
	long long dp[n+1][2 * n * X + 1] = {0};
	dp[0][n * X] = 1;
	for(int j = 1; j <= n; j++) {
		for(int t = 0; t <= 2 * n * X; t++){
			if(t-Y[j-1] < 0 || t-Y[j-1] > 2 * n * X)
				dp[j][t] = dp[j-1][t];
			else
				dp[j][t] = dp[j-1][t] + dp[j-1][t - Y[j-1]];
		}
	}
	return dp[n][n*X]-1;
}

int main(){
	int n,a;
	cin >> n >> a;
	for(int i = 0; i < n;i++){
		int x; cin >> x;
		Y[i] = x - a;
	}
	cout << solve(n,a) << endl;
}

