#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> int_pair;
#define FOR(I,A,B) for(int I = (A); I < (B); ++I)
#define CLR(mat) memset(mat, 0, sizeof(mat))
const int N=50;
const int NX = 2500;
 
int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	int n,a,x[N+1];
	int dp[N+1][N+1][NX+1];
	cin >> n >> a;
	FOR(i,1,n+1)cin >> x[i];
	FOR(j,0,n+1){
		FOR(k,0,n+1){
			FOR(s,0,n*50+1){
				if(j==0 && k==0 && s==0)dp[0][0][0]=1;
				else if(j>=1 && s<x[j])
					dp[j][k][s]=dp[j-1][k][s];
				else if(j>=1 && k>=1 && s>=x[j])
					dp[j][k][s]=dp[j-1][k][s]+dp[j-1][k-1][s-x[j]];
				else dp[j][k][s]=0;
			}
		}
	}
	unsigned ll ans=0;
	FOR(k,1,n+1){
		ans += dp[n][k][k*a];
	}
	cout << ans << endl;
	return 0;
}