#include <iostream>
#include <algorithm>

using namespace std;
typedef long long ll;

const int MAX_N = 50;
const int MAX_A = 50;

ll dp[MAX_N+1][MAX_A*MAX_N*2];

int main() {
	int N, A, tmp;
	int card[MAX_N];
	cin >> N >> A;
	for(int i=0;i<N;i++) {
		cin >> tmp;
		card[i] = tmp - A;
	}
	dp[0][MAX_A*MAX_N] = 1;
	for(int i=0;i<N;i++) {
		for(int j=0;j<MAX_A*MAX_N*2;j++) {
			if(dp[i][j] == 0) continue; 
			dp[i+1][j+card[i]] += dp[i][j];
			dp[i+1][j] += dp[i][j];
		}
	}
	cout << dp[N][MAX_A*MAX_N]-1 << endl;

	return 0;
}
