#include <bits/stdc++.h>
using namespace std;
 
#define rep(i, n) for (int i = 0; i < (n); i++)
 
int main(){
	int N,A;
	cin >> N >> A;
	vector<int> X(N);
	rep(i,N) cin >> X[i];
	int M = *max_element(X.begin(),X.end());
	int sum = accumulate(X.begin(),X.end(),0);
	long long dp[N+1][N+1][N*M+1] = {};
	dp[0][0][0] = 1;
	rep(i,N){
		rep(j,N){
			rep(k,N*M){
				if(dp[i][j][k]){
					dp[i+1][j][k] += dp[i][j][k];
					dp[i+1][j+1][k+X[i]] += dp[i][j][k];
				}
			}
		}
	}
	long long res=0;
	rep(i,N) res += dp[N][i+1][(i+1)*A];
	cout << res << endl;

    return 0;
}