#include <iostream>
using namespace std;

const int MAXN = 55;
long long dp[MAXN][MAXN * MAXN];
int n, A, a[MAXN];

int main() {
	cin >> n >> A;
	for (int i = 0; i < n; i++)
		cin >> a[i];
	dp[0][0] = 1;
	for (int t = 0; t < n; t++)
		for (int j = MAXN * MAXN - 1; j >= 0; j--)
			for (int i = MAXN - 1; i >= 1; i--)
				if (j - a[t] >= 0)
					dp[i][j] += dp[i - 1][j - a[t]];
	long long ans = 0;
	for (int i = 1; i <= n; i++)
		ans += dp[i][i * A];
	cout << ans;
}