#include"bits/stdc++.h"
#include<boost/multi_array.hpp>
#include<boost/optional.hpp>
#include<boost/range/irange.hpp>
#include<boost/range/algorithm.hpp>
#include<boost/range/adaptors.hpp>
using namespace std;
namespace adaptor = boost::adaptors;

#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep3(i,m,n) for(int (i)=m;(i)<=(n);(i)++)
#define rep3rev(i,m,n) for(int (i)=m;(i)>=(n);(i)--)
typedef long long ll;


void Main()
{
	int N, A;
  	cin >> N >> A;
  	vector<int> x(N);
  	int Xmax = 0;
  	rep(i,N){
        cin >> x[i];
      	x[i] -= A;
      	Xmax = max(Xmax,abs(x[i]));
      	//cout << x[i] << " ";
    }
  	//cout << endl;
	
  	if(N == 1){
        // 例外処理1
      	if(x[0] == 0){ 
          	cout << 1 << endl; 
		}
      	else{
        	cout << 0 << endl;
        }
        return;
    }
  	if(Xmax==0){
        // 例外処理2
      	ll ans = pow(2,N);
      	cout << ans-1 << endl;
      	return;
    }
  
	int T = 2*N*Xmax+1;   
 	vector<vector<ll>> dp(N+1, vector<ll>(T));
	
  	rep(t,T){
  		dp[0][t] = 0;
    }
  	dp[0][N*Xmax] = 1;
  
  	//rep(t,T) cout << 0 << "," << t-N*Xmax << ": " << dp[0][t] << endl;
  
  	rep3(j,1,N){
      rep(t,T){
        if(t-x[j] < 0 || t-x[j] > T-1){
			dp[j][t] = dp[j-1][t];
        }
        else{
			dp[j][t] = dp[j-1][t] + dp[j-1][t-x[j-1]];            	
        }
        //cout << j << "," << t-N*Xmax << ": " << dp[j][t] << endl;
      }
    }
	cout << dp[N][N*Xmax] - 1 << endl;  
	return;
}

int main()
{
	cin.tie(nullptr);
	ios_base::sync_with_stdio(false);
	cout << fixed << setprecision(15);
	Main();
	return 0;
}
