#include <bits/stdc++.h>
using namespace std;
int n;
vector<float> a;
float average_needed;
int solve() {
  int count = 0;
  for (int i = 0; i < (1 << n); i++) {
    float current_average = 0;
    int total_set_bits = 0;
    for (int j = 0; j < n; j++) {
      if (i & (1 << j)) {
        current_average += a[j];
        total_set_bits += 1;
      }
    }
    if (current_average / total_set_bits == average_needed) {
      count += 1;
    }
  }
  return count;
}
int main() {
  cin >> n >> average_needed;
  a.resize(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  int res = solve();
  cout << res << endl;
}
