#include<stdio.h>
#include<stdlib.h>
#include<string.h>
typedef long long ll;
ll dp[55][2600];
int v[55];
int main(void)
{
	int N, A;
	ll sum = 0;
	scanf("%d %d", &N, &A);
	for (int i = 1; i <= N; i++)
		scanf("%d", &v[i]);
	dp[0][0] = 1;
	for (int k = 1; k <= N; k++)
	{
		sum += v[k];
		for (int i = k; i >=1; i--)
			for (int j = sum; j >= v[k]; j--)
				dp[i][j] += dp[i - 1][j - v[k]];
	}
	ll ans = 0;
	for (int i = 1; i <= N; i++)
		ans += dp[i][i * A];
	printf("%lld\n", ans);
	return 0;
}