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

//部分点解法

int main(){
	int n,a;
	cin >> n >> a;
	vector<int> x(n);
	rep(i,n){
		cin >> x[i];
	}
	
	ll ans = 0;
	rep(bit, 1<<n){
		if(bit == 0) continue;
		ll sum = 0;
		ll count = 0;
		rep(i,n){
			if(bit & (1<<i)){
				sum += x[i];
				count++;
			}
		}
		if(a*count == sum) {
			ans++;
		}
		
	}
	
	cout << ans << endl;
    return 0;
}