#include<bits/stdc++.h>
#define LL long long
using namespace std;
LL f[55][5210],x[55];
LL cl(LL k){return k+2500LL;}
int main()
{
	LL n,A,i,j;
	scanf("%lld %lld",&n,&A);
	for(i=1;i<=n;i++){scanf("%lld",&x[i]);x[i]-=A;}
	
	//f[i][j]前i个,凑出j的方案数
	memset(f,0,sizeof(f)); 
	f[0][cl(0)]=1;
	for(i=1;i<=n;i++)
	{
		for(j=-2500;j<=2500;j++)
		{
			if(j-x[i]>=-2500)f[i][cl(j)]+=f[i-1][cl(j-x[i])];
			f[i][cl(j)]+=f[i-1][cl(j)];
		}
	}
	printf("%lld",f[n][cl(0)]-1LL);
	return 0;
}