#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
using P = pair<int, int>;
const int MOD = 1e9 + 7;
vector<ll> bitSearch(int bit, int n) {
  vector<ll> S;
  for (int i = 0; (i) < (int)(n); i++)
    if (bit & (1 << i)) S.push_back(i);
  return S;
}
int main() {
  ll n, a;
  cin >> n >> a;
  vector<ll> x(n);
  for (int i = 0; (i) < (int)(n); i++) cin >> x[i];
  ll res = 0;
  for (ll bit = 0; bit < (1 << n); bit++) {
    vector<ll> S = bitSearch(bit, n);
    ll sz = S.size();
    if (sz == 0) continue;
    ll sum = 0;
    for (ll s : S) {
      sum += x[s];
    }
    if (sum == a * sz) res++;
  }
  cout << res << endl;
}
