#include <bits/stdc++.h>
int main(int argc, char** argv) {
  std::cin.tie(0);
  std::ios_base::sync_with_stdio(0);
  std::cout << std::fixed << std::setprecision(6);
  std::cerr << std::fixed << std::setprecision(6);
  int N, A, x[55];
  std::cin >> N >> A;
  for (int i = 0; i < N; i++) std::cin >> x[i];
  std::vector<std::vector<std::vector<int>>> dp(
      2, std::vector<std::vector<int>>(3333, std::vector<int>(55, 0)));
  std::vector<std::vector<int>>&curr = dp[0], &next = dp[1];
  long long c = 0;
  curr[0][0] = 1;
  for (int i = 0; i < N; i++) {
    for (auto& j : next) std::fill(std::begin(j), std::end(j), 0);
    for (int j = 0; j < 3333; j++)
      for (int k = 0; k < 55; k++) {
        if (curr[j][k]) {
          next[j][k] += curr[j][k];
          next[j + x[i]][k + 1] += curr[j][k];
          if (j + x[i] == A * (k + 1)) c += curr[j][k];
        }
      }
    std::swap(curr, next);
  }
  std::cout << c << std::endl;
  return 0;
}
