#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
typedef long long ll;
const int N=2550;
ll f[6007][57]={0};
int n,a,num[57];
int main()
{
	scanf("%d%d",&n,&a);
	for (int i = 1; i <= n; ++i)
	{
		int x;
		scanf("%d",&x);
		num[i]=x-a;
	}
	for (int i = 1; i <= n; ++i)
	{
		for (int j = 55; j < 5057; ++j)
		{
			f[j][i]+=f[j][i-1];
			f[j+num[i]][i]+=f[j][i-1];
		}
		f[N+num[i]][i]++;
	}
	printf("%lld\n", f[N][n]);
	return 0;
}