#include <bits/stdc++.h>
using namespace std;
using LL = long long;
vector<int> x;
LL bad_solution(int n, int a) {
  LL ans = 0;
  for (int i = 0; i < (1 << n); i++) {
    int sum = 0, el = 0;
    for (int j = 0; j < n; j++) {
      if (i & (1 << j)) {
        sum += x[j];
        el++;
      }
    }
    if (el != 0 and sum / el == a and sum % el == 0) {
      ans++;
    }
  }
  return ans;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  int N, A;
  cin >> N >> A;
  x.resize(N);
  for (int i = 0; i < N; ++i) {
    cin >> x[i];
  }
  sort(x.begin(), x.end());
  cout << bad_solution(N, A) << endl;
  return 0;
}
