#include <bits/stdc++.h>
#define REP(i, a, b) for(int i = a; i < b; i++)
#define REV(i, b, a) for(int i = b; i >= a; i--)
#define show(a) cout << #a << " = " << a << endl
#define mp make_pair
#define pb push_back
#define mset(v, a) memset(v, a, sizeof(v))
#define printv(v, n) for(int CONTADOR = 0; CONTADOR < n; CONTADOR++){ cout << v[CONTADOR] << " ";} cout << endl;
#define printm(mat, n, m) for(int OUTROCONTADOR = 0; OUTROCONTADOR < n; OUTROCONTADOR++) printv(mat[OUTROCONTADOR], m);
#define int long long
using namespace std;
inline string tostr(int a){stringstream ss; ss<<a; return ss.str();}
int n, a;
int v[100];
int dp[100][255][50];
int solve(int k, int num, int den){
	if(k >= n) {
		if(den != 0) return num/double(den) == a;
		return 0;
	}
	if(dp[k][num][den] >= 0) return dp[k][num][den];
	int ans = 0;
	ans += solve(k+1, num+v[k], den+1);
	ans += solve(k+1, num, den);
	return dp[k][num][den] = ans;
}

main(){

	while(cin >> n >> a){
		mset(dp, -1);
		REP(i, 0, n) cin >> v[i];
		cout << solve(0, 0, 0) << endl;
	}
	
	return 0;
}
