
#include <iostream>
#include <cstdio>
#include <cstring>
#define N 55
using namespace std;

typedef long long ll;
ll n, m, i,a[N], s[N][N][2505];
ll f(ll p, ll q,ll w) {
	if (p == n) return (q >0 && q * m == w ? 1 : 0);
	if (s[p][q][w] != -1) return s[p][q][w];
	return s[p][q][w] = f(p + 1, q, w) + f(p + 1, q + 1, w + a[p]);
}
int main()
{
	cin >> n >> m;
	for (i = 0; i < n; i++) {
		scanf ("%lld", &a[i]);
	}
	memset(s, -1, sizeof(s));
	cout << f(0, 0, 0);
    return 0;
}