#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a;
  cin >> n >> a;
  vector<int> x(n);
  copy_n(istream_iterator<int>(cin), n, (x).begin());
  ;
  long long int ans = 0;
  for (long long int i = 0; i < (long long int)1 << n; ++i) {
    if (i == 0) continue;
    int sum = 0;
    int bits = 0;
    for (long long int j = 0; j < n; ++j) {
      if (((i >> j) & 1) == 1) {
        sum += x[j];
        bits++;
      }
    }
    if (sum == bits * a) {
      ans++;
    }
  }
  cout << ans << endl;
  return 0;
}
