#include <bits/stdc++.h>
#define rep(i,a,n) for(int i = a;i < n;i++)
typedef unsigned long long ull;
typedef long long ll;
using namespace std;


ull gcd(ull a,ull b){
	if(!b) return a;
	return gcd(b,a%b);
}


int main(){
	ll n,a,cnt = 0;
	cin >> n >> a;
	ll x[n] = {0},dp[n+1][n+1][2501] = {0};
	
	rep(i,0,n){
		cin >> x[i];
	}
	
	rep(i,0,n+1){
		rep(j,0,n+1){
			rep(k,0,n*a+1){
				if(i == 0 && j == 0 && k == 0){
					dp[i][j][k] = 1;
				}
				else if(i >= 1 && j >= 1 && k >= x[i-1]){
					dp[i][j][k] = dp[i-1][j-1][k-x[i-1]]+dp[i-1][j][k];
				}
				else if(i >= 1 && k < x[i-1]){
					dp[i][j][k] = dp[i-1][j][k];
				}
				else{
					dp[i][j][k] = 0;
				}
			}
		}
	}
	
	rep(i,1,n){
		cnt += dp[n][i][i*a];
	}
	
	cout << cnt << endl;
	
	return 0;
}