#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<queue>
#define lol(i,n) for(int i=0;i<n;i++)
using namespace std;
long long dp[61][2511];
int main(){
	int n,k;
	cin>>n>>k;
	lol(i,n+1){
		lol(j,2501){
			dp[i][j]=0;
		}
	}dp[0][0]=1;
	lol(u,n){
		int a;cin>>a;
		for(int i=n-1;i>=0;i--){
			lol(j,2501){
				if(i+1<=n&&j+a<2501){
					dp[i+1][j+a]+=dp[i][j];
				}
			}
		}
	}
	long long ans=0;
	for(int i=1;i<=n;i++){
		ans+=dp[i][i*k];
	}
	cout<<ans<<endl;
	return 0;
}
