#include <bits/stdc++.h>
const int INF = (int)1e9;
const long long MOD = (long long)1e9 + 7;
const long long LINF = (long long)1e18;
const double PI = acos(-1.0);
const double EPS = 1e-9;
using namespace ::std;
void solve() {
  int N, A;
  cin >> N >> A;
  vector<int> X(N);
  for (int i = 0; i < N; ++i) {
    cin >> X[i];
  }
  const int dpMAX = A * N;
  vector<vector<int> > dp(N + 1, vector<int>(dpMAX + 1, 0));
  dp[0][0] = 1;
  for (int i = 0; i < N; ++i) {
    for (int take = N - 1; take >= 0; --take) {
      const int indexMAX = dpMAX - X[i];
      for (int index = indexMAX; index >= 0; --index) {
        if (dp[take][index]) {
          dp[take + 1][index + X[i]] += dp[take][index];
        }
      }
    }
  }
  long long ans = 0;
  for (int take = 1; take <= N; ++take) {
    ans += dp[take][A * take];
  }
  cout << ans << endl;
}
signed main(void) {
  std::cin.tie(0);
  std::ios::sync_with_stdio(false);
  std::cout << std::fixed;
  cout << setprecision(16);
  solve();
}
