# include "iostream"
# include "cstdio"

using namespace std;

const int maxm=50+10;

int N,A;
int X[maxm];
long long DP[maxm][maxm*maxm];

int main(){
	register int i,j,k;
	register long long Ans=0;
	scanf("%d%d",&N,&A);
	DP[0][0]=1;
	for(i=1;i<=N;i++) scanf("%d",X+i);
	for(i=1;i<=N;i++){
		for(j=i;j;j--){
			for(k=X[i];k<=2500;k++){
				DP[j][k]+=DP[j-1][k-X[i]];
			}
		}
	}
	for(i=1;i<=N;i++){
		Ans+=DP[i][i*A];
	}
	printf("%lld",Ans);
	return 0;
}