#include <bits/stdc++.h>
using namespace std;
void addMono(vector<int> *m) {
  m->at(0) += 1;
  for (int i = 0; i < m->size(); i++) {
    if (m->at(i) > 1 && i + 1 != m->size()) {
      m->at(i) = 0;
      m->at(i + 1) += 1;
    }
  }
}
bool checkMono(vector<int> *m) {
  for (int i = 0; i < m->size(); i++) {
    if (m->at(i) <= 0) return false;
  }
  return true;
}
long long int muriyari(vector<int> *v, int a) {
  long long int result = 0;
  vector<int> mono;
  for (int i = 0; i < v->size(); i++) {
    mono.push_back(0);
  }
  do {
    addMono(&mono);
    int sum = 0;
    int cnt = 0;
    for (int i = 0; i < mono.size(); i++) {
      if (mono.at(i) > 0) {
        sum += v->at(i);
        cnt++;
      }
    }
    if (sum / cnt == a && sum % cnt == 0) result++;
  } while (!checkMono(&mono));
  return result;
}
int main() {
  int n, a;
  vector<int> v;
  cin >> n >> a;
  for (int i = 0; i < n; i++) {
    int t;
    cin >> t;
    v.push_back(t);
  }
  cout << muriyari(&v, a) << endl;
}
