#include <bits/stdc++.h>
using namespace std;
using UI = unsigned int;
using UL = unsigned long;
using LL = long long;
using ULL = unsigned long long;
using VI = vector<int>;
using VVI = vector<VI>;
using VLL = vector<LL>;
using VVLL = vector<VLL>;
using VS = vector<string>;
using PII = pair<int, int>;
using VP = vector<PII>;
template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
int dp[51][51][2501];
void solve() {
  int n, a;
  cin >> n >> a;
  VI x(n);
  for (int i = int(0); i < int(n); i++) cin >> x[i];
  dp[0][1][x[0]] = 1;
  dp[0][0][0] = 1;
  LL ans = 0;
  for (int i = int(1); i < int(n); i++) {
    dp[i][0][0] = 1;
    for (int j = int(1); j < int(n + 1); j++) {
      for (int k = int(1); k < int(a * n + 1); k++) {
        dp[i][j][k] = dp[i - 1][j][k];
        if (k - x[i] >= 0) dp[i][j][k] += dp[i - 1][j - 1][k - x[i]];
      }
    }
  }
  for (int i = int(1); i < int(n + 1); i++) {
    ans += dp[n - 1][i][i * a];
  }
  cout << ans << endl;
}
signed main() {
  solve();
  return 0;
}
