#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, A;
  cin >> N >> A;
  vector<int> x(N);
  for (int i = 0; i < N; ++i) cin >> x[i];
  sort(x.begin(), x.end());
  long long counter = 0;
  vector<vector<vector<vector<int> > > > subsetCount(
      N, vector<vector<vector<int> > >(50 * 50));
  for (int i = 0; i < N; ++i) {
    if (i == 0) {
      for (int j = 0; j < N; ++j) subsetCount[0][x[j]].push_back({j});
    } else {
      for (int j = 0; j < N; ++j) {
        for (int k = 0; k < 50 * 50; ++k) {
          for (int l = 0; l < subsetCount[i - 1][k].size(); ++l) {
            bool isPresent = false;
            for (int m = 0;
                 m < subsetCount[i - 1][k][l].size() && isPresent == false;
                 ++m) {
              if (subsetCount[i - 1][k][l][m] >= j) isPresent = true;
            }
            if (isPresent == false) {
              subsetCount[i][k + x[j]].push_back(subsetCount[i - 1][k][l]);
              subsetCount[i][k + x[j]].back().push_back(j);
            }
          }
        }
      }
    }
    counter += subsetCount[i][A * (i + 1)].size();
  }
  cout << counter << endl;
}
