#include<iostream>
#include<cstring>
using namespace std;

typedef long long ll;
const int N = 55;

ll n, A, a[N], mm[N][N][N * N];

ll dp(int i, int cnt, int sum) {
	if (i == n) {
		if (cnt == 0)return 0;
		if ((sum / cnt) == A && (sum % cnt == 0))return 1;
		return 0;
	}

	ll& ret = mm[i][cnt][sum];
	if (ret != -1)return ret;
	return ret = dp(i + 1, cnt, sum) + dp(i + 1, cnt + 1, sum + a[i]);
}

int main() {
	cin >> n >> A;
	for (int i = 0; i < n; i++)cin >> a[i];
	memset(mm, -1, sizeof mm);
	cout << dp(0, 0, 0) << endl;

	return 0;
}