#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;
  int tempCnt = 1;
  vector<pair<int, int>> tempP;
  for (int i = 0; i < N; i++) {
    int temp;
    cin >> temp;
    if (temp == A) {
      cntA++;
    } else {
      vc.push_back(temp);
      tempP.push_back(make_pair(temp, tempCnt));
      tempCnt++;
    }
  }
  int vcLen = vc.size();
  long long int tempAns = 0;
  sumVc.push_back(vc);
  memVc.push_back(tempP);
  for (int idx = 1; idx < vcLen; idx++) {
    int sumLen = sumVc[idx - 1].size();
    vector<int> temp;
    vector<pair<int, int>> P;
    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];
        temp.push_back(tempSum);
        P.push_back(make_pair(tempSum, cnt + 1));
      }
    }
    sumVc.push_back(temp);
    memVc.push_back(P);
  }
  for (int i = 0; i < vcLen; i++) {
    tempAns += count(sumVc[i].begin(), sumVc[i].end(), A * (i + 1));
  }
  long long int ans = (tempAns + 1) * pow(2.0, cntA) - 1;
  cout << ans << endl;
  return 0;
}
