#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, A;
  cin >> N >> A;
  vector<int> vc;
  vector<vector<int>> sumVc;
  vector<vector<pair<int, int>>> memVc;
  int cntA = 0;
  for (int i = 0; i < N; i++) {
    int temp;
    cin >> temp;
    if (temp == A) {
      cntA++;
    } else {
      vc.push_back(temp);
    }
  }
  vector<pair<int, int>> tempP;
  int maxStart = 0;
  sort(vc.begin(), vc.end());
  int vcLen = vc.size();
  bool greaterFlg = false;
  for (int i = 0; i < vcLen; i++) {
    if (vc[i] > A) {
      if (i > (vcLen / 2)) {
        break;
      } else {
        greaterFlg = true;
        break;
      }
    }
    tempP.push_back(make_pair(vc[i], i + 1));
  }
  if (greaterFlg) {
    tempP.clear();
    sort(vc.begin(), vc.end(), greater<int>());
    for (int i = 0; i < vcLen; i++) {
      if (vc[i] < A) break;
      tempP.push_back(make_pair(vc[i], i + 1));
    }
  }
  long long int tempAns = 0;
  memVc.push_back(tempP);
  for (int idx = 1; idx < vcLen; idx++) {
    int sumLen = memVc[idx - 1].size();
    vector<pair<int, int>> P;
    int limit = A * (idx + 1);
    for (int sumIdx = 0; sumIdx < sumLen; sumIdx++) {
      int tempStart = memVc[idx - 1][sumIdx].second;
      for (int cnt = tempStart; cnt < vcLen; cnt++) {
        int tempSum = memVc[idx - 1][sumIdx].first + vc[cnt];
        if (((greaterFlg == false) && (tempSum > limit)) ||
            (greaterFlg == true) && (tempSum < limit))
          continue;
        if (tempSum == A * (idx + 1)) tempAns++;
        P.push_back(make_pair(tempSum, cnt + 1));
      }
    }
    memVc.push_back(P);
  }
  long long int ans = (tempAns + 1) * pow(2.0, cntA) - 1;
  cout << ans << endl;
  return 0;
}
