#include <bits/stdc++.h>
using namespace std;
const long long int INF = 1e18;
const long long int mod = 1e9 + 7;
struct Edge {
  long long int to, weight;
  Edge(long long int t, long long int w) : to(t), weight(w) {}
};
using graph = vector<vector<long long int>>;
using Graph = vector<vector<Edge>>;
long long int gcd(long long int a, long long int b) {
  if (b == 0) {
    return a;
  } else {
    return gcd(b, a % b);
  }
}
long long int lcm(long long int a, long long int b) {
  return a / gcd(a, b) * b;
}
long long int keta(long long int N) {
  int tmp{};
  while (N > 0) {
    tmp += (N % 10);
    N /= 10;
  }
  N = tmp;
  return N;
}
bool kai(string S) {
  bool flag = true;
  for (long long int i = 0; i < S.size() / 2; ++i) {
    if (S[i] != S[S.size() - i - 1]) {
      flag = false;
      break;
    }
  }
  return flag;
}
int main() {
  long long int n, a;
  cin >> n >> a;
  vector<long long int> x(n);
  for (long long int i = 0; i < n; ++i) {
    cin >> x[i];
  }
  sort(x.begin(), x.end());
  long long int ans = 0;
  for (long long int bit = 0; bit < (1 << n); ++bit) {
    long double flag = 0;
    long long int count = 0;
    for (long long int i = 0; i < n; ++i) {
      if (bit & (1 << i)) {
        flag += (long double)x[i];
        count++;
      }
    }
    if (flag / count == (long double)a) {
      ans++;
    }
  }
  cout << ans << endl;
  return 0;
}
