#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define f(i,x,n) for (int i = x;i < n;++i)

ll d[2501][51];

int main() {
	int n, k;
	scanf("%d%d", &n, &k);
	d[0][0] = 1;
	f(i, 0, n) {
		int t;
		scanf("%d", &t);
		for (int j = 50; j > 0; --j) {
			f(i, t, 2501)d[i][j] += d[i - t][j - 1];
		}
	}
	ll an = 0;
	int i = 1, t = k;
	while (i < 51 && k < 2501) {
		an += d[k][i];
		k += t;
		++i;
	}
	printf("%lld", an);
}