#include <stdio.h>
int n, a, x;
long long d[51][2501], ans;
int main() {
	scanf("%d%d", &n, &a);
	d[0][0] = 1;
	for (int i = 0; i < n; i++) {
		scanf("%d", &x);
		for (int i = n - 1; i >= 0; i--) {
			for (int j = 0; j <= 50 * i; j++) {
				if (d[i][j])d[i + 1][j + x] += d[i][j];
			}
		}
	}
	for (int i = 1; i <= n; i++) {
		ans += d[i][i * a];
	}
	printf("%lld\n", ans);
}