#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a;
  cin >> n >> a;
  vector<int> x;
  x.resize(n);
  for (auto &m : x) cin >> m;
  vector<map<int, vector<int>>> map_(n + 1);
  vector<int> z(1, -1);
  map_.at(0).insert(make_pair(0, z));
  long long int sum = 0;
  for (int m = 0; m < n; ++m) {
    for (auto &t : map_.at(m)) {
      for (int v = 0; v < n; ++v) {
        vector<int> vec = t.second;
        if (find(vec.begin(), vec.end(), v) == vec.end() || vec.size() == 1) {
          vec.pop_back();
          vec.push_back(v);
          sort(vec.begin(), vec.end());
          vec.push_back(-1);
          bool flag = true;
          for (auto &c : map_.at(m + 1))
            if (c.second == vec) flag = false;
          if (flag) {
            map_.at(m + 1).insert(make_pair(t.first + x.at(v), vec));
            if ((t.first + x.at(v) * 1.0) / ((m + 1) * 1.0) == a) {
              ++sum;
            }
          }
        }
      }
    }
  }
  cout << sum << endl;
  return 0;
}
