#include<stdio.h>
#include<vector>
#include<algorithm>
using namespace std;
typedef long long ll;
ll dp[51][5001];
int main()
{
	int num, mok;
	scanf("%d%d", &num, &mok);
	dp[0][2500] = 1;
	for (int i = 0; i < num; i++)
	{
		int z;
		scanf("%d", &z);
		z -= mok;
		for (int j = -2500; j <= 2500; j++)
		{
			if (-2500 <= j + z&&j + z <= 2500)
			{
				dp[i + 1][j + z + 2500] += dp[i][j + 2500];
			}
			dp[i + 1][j + 2500] += dp[i][j + 2500];
		}
	}
	printf("%lld\n", dp[num][2500] - 1);
}