#include <bits/stdc++.h>
using namespace std;
namespace {
template <class T>
ostream& operator<<(ostream& os, const vector<T>& vs) {
  if (vs.empty()) return os << "[]";
  os << "[" << vs[0];
  for (int i = 1; i < vs.size(); i++) os << " " << vs[i];
  return os << "]";
}
template <class T>
istream& operator>>(istream& is, vector<T>& vs) {
  for (auto it = vs.begin(); it != vs.end(); it++) is >> *it;
  return is;
}
int N, A;
vector<int> X;
void input() {
  cin >> N >> A;
  X.resize(N);
  cin >> X;
}
void solve() {
  int MX = 0;
  for (int i = 0; i < N; i++) MX = max(MX, X[i]);
  long long dp[N + 1][N + 1][N * MX + 1];
  memset(dp, 0, sizeof(dp));
  dp[0][0][0] = 1;
  for (int i = 1; i <= N; i++) {
    for (int k = 0; k <= i; k++) {
      for (int a = 0; a <= N * MX; a++) {
        dp[i][k][a] = dp[i - 1][k][a];
        if (k - 1 >= 0 && a - X[i - 1] >= 0) {
          dp[i][k][a] += dp[i - 1][k - 1][a - X[i - 1]];
        }
      }
    }
  }
  long long ans = 0;
  for (int m = 1; m <= N; m++) {
    ans += dp[N][m][m * A];
  }
  cout << ans << endl;
}
}  // namespace
int main() {
  input();
  solve();
  return 0;
}
