#include<bits/stdc++.h>
#define N 55
#define ll long long
using namespace std;
ll f[N][N*N],ans=0;
int x,a,n;
int main(){
	f[0][0]=1,scanf("%d%d",&n,&a);
	for(int i=1;i<=n;++i){
		scanf("%d",&x);
		for(int j=i;j;--j)for(int k=2500;k>=x;--k)f[j][k]+=f[j-1][k-x];
	}
	for(int i=1;i<=n;++i)ans+=f[i][i*a];
	cout<<ans;
	return 0;
}
