#include <bits/stdc++.h>

using namespace std;
const int MAXN=51,ZERO=2550;
typedef long long ll;
int n,a,x,cur;
ll dp[2][2*ZERO];

int main() 
{
	scanf("%d%d",&n,&a);
	dp[cur^1][ZERO]=1;
	for (int i=1;i<=n;i++,cur^=1)
	{
		scanf("%d",&x);x-=a;
		for (int j=MAXN;j+MAXN<2*ZERO;j++)
			dp[cur][j]=dp[cur^1][j]+dp[cur^1][j-x];
	}
	printf ("%lld\n",dp[cur^1][ZERO]-1);
}