process.stdin.resume();
process.stdin.setEncoding('ascii');

var input_stdin = "";
var input_stdin_array = "";
var input_currentline = 0;

process.stdin.on('data', function (data) {
    input_stdin += data;
});

process.on('SIGINT', function(){
    input_stdin_array = input_stdin.split("\n");
    main();
    process.exit();
});

process.stdin.on('end', function () {
    input_stdin_array = input_stdin.split("\n");
    main();    
});

function readLine() {
    return input_stdin_array[input_currentline++];
}

/////////////// ignore above this line ////////////////////

function main() {
	/*reading input*/
	var s = readLine().split(" ");	
	var N = parseInt(s[0]);
	var X = parseInt(s[1]);
	s = readLine().split(" ");
	var a = [0];
	for (var i=0; i < N; i++) a.push(parseInt(s[i]));
	
	/*building dp matrix*/
	var dp = [];
	for (var i=0; i <= N; i++) {
		dp.push([]);
		for (var j=0; j <= 50*50; j++){
			dp[i].push(0);
		}
	}
	
	/* calculating dp */
	dp[0][0]=1;
	for (var e=1; e <= N; e++){
		for (var i=N; i >= 1; i--){
			for (var j=0; j <= 50*50; j++){
				if (j - a[e] >= 0){
					dp[i][j] += dp[i-1][j-a[e]];
				}
			}
		}
	}
	
	/* calculating the answer */
	var ans=0;
	for (var i=1; i <= N; i++){
		ans += dp[i][X*i];
	}
	
	console.log(ans.toString());
}
