#include <bits/stdc++.h>
using namespace std;
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;
}
using ll = long long;
ll dp[51][5003];
int main() {
  int n, a;
  cin >> n >> a;
  vector<int> x(n);
  for (int i = (0), i_len = (n); i < i_len; ++i) cin >> x[i];
  for (int i = (0), i_len = (n); i < i_len; ++i) x[i] -= a;
  int max = *([&](decltype((x)) whole) {
    return (max_element)(begin(whole), end(whole));
  })(x);
  dp[0][n * max] = 1;
  for (int i = (0), i_len = (n); i < i_len; ++i)
    for (int j = (0), j_len = (2 * n * max); j < j_len; ++j) {
      dp[i + 1][j] = dp[i][j];
      if (0 <= j - x[i] && j - x[i] <= 2 * n * max)
        dp[i + 1][j] += dp[i][j - x[i]];
    }
  cout << dp[n][n * max] - 1 << endl;
  return 0;
}
