#include <bits/stdc++.h>
using namespace std;
template <class T>
using VV = vector<vector<T>>;
template <class T>
inline T SMIN(T& a, const T b) {
  return a = (a > b) ? b : a;
}
template <class T>
inline T SMAX(T& a, const T b) {
  return a = (a < b) ? b : a;
}
template <class Iter>
void __kumaerrc(Iter begin, Iter end) {
  for (; begin != end; ++begin) {
    cerr << *begin << ',';
  }
  cerr << endl;
}
void __kumaerr(istream_iterator<string> it) {
  (void)it;
  cerr << endl;
}
template <typename T, typename... Args>
void __kumaerr(istream_iterator<string> it, T a, Args... args) {
  cerr << *it << "=" << a << ", ", __kumaerr(++it, args...);
}
template <typename S, typename T>
std::ostream& operator<<(std::ostream& _os, const std::pair<S, T>& _p) {
  return _os << "{" << _p.first << ',' << _p.second << "}";
}
const int MAX_N = 50 + 1;
int X[MAX_N];
int N, A;
const int MAX_S = MAX_N * MAX_N;
long long dp[MAX_N][MAX_S];
void solve() {
  dp[0][0] = 1;
  for (int i = 0; i < (N); ++i)
    for (int cnt = N; cnt >= 0; --cnt)
      for (int sum = MAX_S - 1; sum >= 0; --sum) {
        if (sum + X[i] < MAX_S) dp[cnt + 1][sum + X[i]] += dp[cnt][sum];
      }
  long long res = 0;
  for (int cnt = (1); cnt <= (N); ++cnt) {
    res += dp[cnt][cnt * A];
  }
  cout << res << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout << setprecision(12) << fixed;
  cin >> N >> A;
  for (int i = 0; i < (N); ++i) cin >> X[i];
  solve();
  return 0;
}
