#include<bits/stdc++.h>
#define ll long long
using namespace std;
const int N=5010;
const int Y=2500;
ll dp[N][N];
int n,x;
int a[N];
int main()
{
	//freopen("H:\\c++1\\in.txt","r",stdin);
	//freopen("H:\\c++1\\out.txt","w",stdout);
	scanf("%d%d",&n,&x);
	dp[0][Y]=1;
	for(int i=1;i<=n;i++)scanf("%d",&a[i]),a[i]-=x;
	for(int i=1;i<=n;i++){
		for(int j=-Y;j<=Y;j++){
			dp[i][j+Y+a[i]]+=dp[i-1][j+Y];
			dp[i][j+Y]+=dp[i-1][j+Y];
		}
	}
	printf("%lld\n",dp[n][Y]-1);
	return 0;
}