#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long N, A;
  cin >> N >> A;
  vector<long long> x(N);
  for (long long i = 0; i < N; i++) {
    cin >> x[i];
    x[i] -= A;
  }
  vector<vector<long long>> dp(50, vector<long long>(6000, 0));
  for (long long i = 0; i < N; i++) {
    dp.at(i + 1).at(x.at(i) + 3000)++;
    for (long long j = 100; j < 6000 - 100; j++) {
      dp.at(i + 1).at(j) += dp.at(i).at(j);
      dp.at(i + 1).at(j + x.at(i)) += dp.at(i).at(j);
    }
  }
  cout << dp.at(N).at(3000) << endl;
  return 0;
}
