#include <bits/stdc++.h>
signed main() {
  long long n, a;
  std::cin >> n >> a;
  std::vector<long long> x(n);
  for (long long i = 0; i < n; i++) std::cin >> x[i];
  std::vector<std::vector<long long> > dp(
      n + 1, std::vector<long long>(50 * 50 + 1, 0));
  dp[0][0] = 1;
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j <= 50 * 50; j++) {
      if (dp[i][j] == 0) continue;
      dp[i + 1][j + x[i]] += dp[i][j];
      dp[i + 1][j] += dp[i][j];
    }
  }
  long long count = 0;
  for (long long i = 1; i <= n; i++) {
    count += dp[n][i * a];
  }
  std::cout << (count) << "\n";
  return 0;
}
