#include <bits/stdc++.h>
using namespace std;
template <typename T>
void DEBUG(T e) {
  if (true == false) return;
  std::cout << e << " ";
}
template <typename T>
void DEBUG(const std::vector<T>& v) {
  if (true == false) return;
  for (const auto& e : v) {
    std::cout << e << " ";
  }
  std::cout << std::endl;
}
template <typename T>
void DEBUG(const std::vector<std::vector<T>>& vv) {
  if (true == false) return;
  for (const auto& v : vv) {
    DEBUG(v);
  }
}
template <class T, class... Ts>
void DEBUG(T d, Ts... e) {
  if (true == false) return;
  DEBUG(d);
  DEBUG(e...);
}
template <class T>
void corner(bool flg, T hoge) {
  if (flg) {
    cout << hoge << endl;
    abort();
  }
}
template <typename T1, typename T2>
inline bool chmax(T1& a, T2 b) {
  return a < b && (a = b, true);
}
template <typename T1, typename T2>
inline bool chmin(T1& a, T2 b) {
  return a > b && (a = b, true);
}
void solve(void) {
  long long N, A;
  cin >> N >> A;
  long long M = N * N + 50;
  vector<long long> m(N);
  for (long long i = 0; i < N; ++i) cin >> m[i];
  vector<vector<vector<long long>>> dp(
      N + 1, vector<vector<long long>>(N + 1, vector<long long>(M + 1, 0)));
  for (long long i = 0; i <= N; ++i) dp[i][0][0] = 1;
  for (long long i = 1; i <= N; ++i) {
    for (long long j = 1; j <= N; ++j) {
      for (long long k = 1; k <= M; ++k) {
        if (k - m[i - 1] < 0) {
          dp[i][j][k] += dp[i - 1][j][k];
        } else {
          dp[i][j][k] += dp[i - 1][j][k] + dp[i - 1][j - 1][k - m[i - 1]];
        }
      }
    }
  }
  long long ans = 0;
  for (long long i = 1; i <= N; ++i) {
    ans += dp[N][i][i * A];
  }
  cout << ans << endl;
  return;
}
int32_t main(int32_t argc, const char* argv[]) {
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);
  std::cout << std::fixed;
  std::cout << std::setprecision(11);
  solve();
  return 0;
}
