#include <bits/stdc++.h>

using namespace std;

const int N = 2500;

long long f[51][N + 10];
int n, m;

int main() {
	scanf("%d%d", &n, &m);
	f[0][0] = 1;

	long long ans = 0;
	
	for (int i = 1; i <= n; ++i) {
		int a;
		scanf("%d", &a);
		for (int j = n; j >= 1; --j) {
			for (int k = N; k >= a; --k) {
				f[j][k] += f[j - 1][k - a];
			}
		}
	}
	
	for (int i = 1; i <= n; ++i) {
		ans += f[i][i * m];
	}
	
	printf("%lld", ans);
	return 0;
}