#include <iostream>
using namespace std;

using int64 = long long;

int64 dp[60][60][2600];

int main() {
	int N, A;
	cin >> N >> A;
	
	int x[50];
	for (int i = 0; i < N; i++) {
		cin >> x[i];
	}
	
	dp[0][0][0] = 1;
	for (int i = 0; i < N; i++) {
		for (int j = 0; j <= i; j++) {
			for (int sum = 0; sum <= 50 * j; sum++) {
				dp[i + 1][j][sum] += dp[i][j][sum];
				dp[i + 1][j + 1][sum + x[i]] += dp[i][j][sum];
			}
		}
	}
	
	int64 ans = 0;
	for (int n = 1; n <= N; n++) {
		ans += dp[N][n][n * A];
	}
	cout << ans << endl;
	
	return 0;
}