#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, A;
  cin >> N >> A;
  vector<int> vc;
  vector<vector<int>> sumVc;
  int cntA = 0;
  for (int i = 0; i < N; i++) {
    int temp;
    cin >> temp;
    if (temp == A) {
      cntA++;
    } else {
      vc.push_back(temp);
    }
  }
  int vcLen = vc.size();
  long long int tempAns = 0;
  sumVc.push_back(vc);
  for (int idx = 1; idx < vcLen; idx++) {
    int start = idx;
    int len = sumVc[idx - 1].size();
    vector<int> temp;
    for (int ii = 0; ii < len; ii++) {
      for (int cnt1 = start; cnt1 < vcLen; cnt1++) {
        for (int cnt2 = cnt1; cnt2 < vcLen; cnt2++) {
          int tempSum = sumVc[idx - 1][ii] + vc[cnt2];
          temp.push_back(tempSum);
        }
        start++;
        break;
      }
    }
    sumVc.push_back(temp);
    temp.clear();
  }
  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;
}
