#include <bits/stdc++.h>
int const MAXV = 50;
int x[MAXV], N, A;
int64_t dp[2][MAXV + 1][MAXV];
int main() {
  std::cin >> N >> A;
  for (int i = 0; i < N; ++i) std::cin >> x[i];
  for (int j = 0; j <= N; ++j)
    for (int v = 0; v < 50; ++v) dp[0][j][v] = 0;
  dp[0][0][50 - A] = 1;
  for (int i = 1; i <= N; ++i)
    for (int j = 0; j <= i; ++j) {
      for (int v = 0; v < 50; ++v) {
        int nv = v + A - x[i - 1];
        int64_t nc =
            (nv >= 0 && nv < 50 && j > 0) ? dp[(i - 1) % 2][j - 1][nv] : 0;
        dp[i % 2][j][v] = dp[(i - 1) % 2][j][v] + nc;
      }
    }
  int64_t ans = 0;
  for (int j = 1; j <= N; ++j) ans += dp[N % 2][j][50 - A];
  std::cout << ans << std::endl;
  return 0;
}
