#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n, a;
  cin >> n >> a;
  vector<int> x(n);
  int d[n];
  for (int i = 0; i < n; i++) {
    cin >> x[i];
  }
  sort(x.begin(), x.end());
  unsigned long ans = 0;
  for (uint64_t i = 1; i <= pow(2, n); i++) {
    int sum = 0;
    int count = 0;
    for (int j = 0; j < n; j++) {
      if (((i >> j) & 1) == 1) {
        sum += x[j];
        count++;
        if (x[j] > a) {
          if (sum > a * count) break;
        }
      }
    }
    if (count != 0 && sum == a * count) ans++;
  }
  cout << ans << endl;
  return 0;
}
