#include <bits/stdc++.h>
using namespace std;
const int INTINF = 1e9;
const long long LLINF = 1e18;
int dp[51][51][2501];
void solve() {
  int N;
  cin >> N;
  int A;
  cin >> A;
  vector<int> x(N + 1);
  int X = A;
  for (int i = 1, i_len = (N); i <= i_len; ++i) {
    cin >> x[i];
    X = max(X, x[i]);
  }
  for (int j = 0, j_len = (N + 1); j < j_len; ++j) {
    for (int k = 0, k_len = (N + 1); k < k_len; ++k) {
      for (int s = 0, s_len = (N * X + 1); s < s_len; ++s) {
        if (j + k + s == 0) {
          dp[j][k][s] = 1;
          continue;
        }
        if (0 < j and s < x[j]) {
          dp[j][k][s] = dp[j - 1][k][s];
          continue;
        }
        if (0 < j and 0 < k and x[j] <= s) {
          dp[j][k][s] = dp[j - 1][k][s] + dp[j - 1][k - 1][s - x[j]];
          continue;
        }
        dp[j][k][s] = 0;
      }
    }
  }
  long long ans = 0;
  for (int i = 1, i_len = (N); i <= i_len; ++i) {
    ans += dp[N][i][i * A];
  }
  cout << ans << endl;
}
int main(int argc, char const *argv[]) {
  cin.tie(0);
  ios::sync_with_stdio(false);
  std::cout << std::fixed << std::setprecision(10);
  solve();
  return 0;
}
