#include <bits/stdc++.h>
using namespace std;
struct Fast {
  Fast() {
    std::cin.tie(0);
    ios::sync_with_stdio(false);
  }
} fast;
void dump_func() {}
template <class Head, class... Tail>
void dump_func(Head&& head, Tail&&... tail) {
  cerr << head;
  if (sizeof...(Tail) == 0) {
    cerr << " ";
  } else {
    cerr << ", ";
  }
  dump_func(std::move(tail)...);
}
template <typename T>
ostream& operator<<(ostream& os, vector<T>& vec) {
  os << "{";
  for (int i = 0; i < vec.size(); i++) {
    os << vec[i] << (i + 1 == vec.size() ? "" : ", ");
  }
  os << "}";
  return os;
}
int dy[] = {0, 0, 1, -1, 0};
int dx[] = {1, -1, 0, 0, 0};
int main() {
  int n, a;
  cin >> n >> a;
  int x[n];
  for (int i = 0; i < (int)(n); i++) cin >> x[i];
  long long sum = accumulate(x, x + n, 0);
  cerr << 112 << ": "
       << "sum"
       << " -> " << sum << '\n';
  long long dp[n + 1][n + 1][sum + 1];
  for (int i = 0; i < (int)(n + 1); i++) {
    for (int j = 0; j < (int)(n + 1); j++) {
      memset(dp[i][j], 0, sizeof(dp[i][j]));
    }
  }
  dp[0][1][x[0]] = 1;
  dp[0][0][0] = 1;
  for (int i = 1; i < n; i++) {
    for (int j = 0; j < i + 2; j++) {
      for (int k = 0; k < sum + 1; k++) {
        if (j >= 1 and k - x[i] >= 0) {
          dp[i][j][k] += dp[i - 1][j - 1][k - x[i]];
        }
        dp[i][j][k] += dp[i - 1][j][k];
      }
    }
  }
  long long res = 0;
  for (int j = 1; j < n; j++) {
    long long k = sum - (n - j) * a;
    res += dp[n - 1][j][k];
  }
  cout << res << endl;
  return 0;
}
