import std.stdio;
import std.conv, std.array, std.algorithm, std.string;
import std.math, std.random, std.range, std.datetime;
import std.bigint;

void main(){
	
	int n, a;
	{
		int[] cs = readln.chomp.split.map!(to!int).array;
		n = cs[0], a = cs[1];
		}
	
	int[] xs = readln.chomp.split.map!(to!int).array;
	int[] ys = xs.map!(x => x - a).array;
	
	long[5001] count;
	count[2500] = 1;
	
	foreach(y; ys){
		long[5001] tmpcount;
		foreach(i; 0 .. 5000){
			tmpcount[i] += count[i];
			if(i + y >= 0 && i + y < 5001) tmpcount[i + y] += count[i];
			}
		foreach(i; 0 .. 5001) count[i] = tmpcount[i];
		}
	
	(count[2500] - 1).writeln;
	
	}