#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, A;
  cin >> N >> A;
  vector<int> arr(N);
  for (int i = 0; i < N; ++i) {
    cin >> arr[i];
  }
  sort(arr.begin(), arr.end());
  stack<vector<int> > S;
  vector<int> state;
  vector<int> state0;
  vector<int> state1;
  int sum;
  int selectnum;
  state.push_back(0);
  state.push_back(0);
  S.push(state);
  long ans = 0;
  while (!S.empty()) {
    state = S.top();
    S.pop();
    sum = state[state.size() - 2];
    selectnum = state[state.size() - 1];
    if (sum > A * selectnum) {
      continue;
    }
    if (sum == A * selectnum && state[state.size() - 3] == 1) ans++;
    if (state.size() == N + 2) continue;
    state0 = state;
    state1 = state;
    state0[state0.size() - 2] = 0;
    state1[state1.size() - 2] = 1;
    state0[state0.size() - 1] = sum;
    state1[state1.size() - 1] = sum + arr[state1.size() - 2];
    state0.push_back(selectnum);
    state1.push_back(selectnum + 1);
    S.push(state0);
    S.push(state1);
  }
  cout << ans << endl;
}
