#include<iostream>
using namespace std;
long long int a[55][6005];
int main(){
	int n,s;
	int i,j,k;
	int c[52];
	cin>>n>>s;
	for(i=0;i<n;i++){
		cin>>c[i];
		c[i]-=s;
	}
	a[0][3000]=1;
	for(i=0;i<n;i++){
		for(j=0;j<6000;j++){
			if(j-c[i]<0 || j-c[i]>=6000){
				a[i+1][j]=a[i][j];
			}else{
				a[i+1][j]=a[i][j]+a[i][j-c[i]];
			}
		}
	}
	cout<<(a[n][3000]-1)<<endl;
	return 0;
}
