#include<iostream>
#include<vector>
#include<cstdio>
#include<string>
#include<algorithm>

#define ll long long

using namespace std;

int main(){
    long long n,a;
    cin>>n>>a;
    vector<vector<ll> > dp(n+1, vector<ll>(50*50+1,0));
    vector<int> x(n);
    for(int i=0; i<n; i++){
	cin>>x[i]; 
	for(int k=i; k>=1; k--){
	for(int j=0; j<=50*50; j++){
		if(dp[k][j]){
		    dp[k+1][j+x[i]] += dp[k][j];
		}
	    }
	}
	dp[1][x[i]]++;
    }
    ll res=dp[1][a];
    for(int i=2; i<=n; i++){
	res+=dp[i][a*i];
    }
    cout<<res;

}