#include <bits/stdc++.h>
using namespace std;

int n, A;
int a[51];
long long ways[51][11000];

int main() {
	scanf("%d %d", &n, &A);
	for (int i = 0; i < n; i++){
		scanf("%d", &a[i]); 
		a[i] -= A;
	}
	ways[0][5000] = 1;
	for (int i = 0; i < n; i++){
		for (int w = -2500; w <= 2500; w++) {
			ways[i + 1][w + 5000] += ways[i][w + 5000];
			ways[i + 1][w + 5000] += ways[i][w + 5000 - a[i]];
		}
	}
	printf("%lld\n", ways[n][5000] - 1);
}
