#include <bits/stdc++.h>
const int MAX_N = 52;
const int MAX_V = 50;
int N, A, x[MAX_N];
int dp[MAX_N][MAX_N][MAX_V * MAX_N] = {};
int main(int argc, char **argv) {
  std::cin >> N >> A;
  for (int i = 1; i <= N; i++) {
    std::cin >> x[i];
  }
  int sum = 0;
  for (int i = 1; i <= N; i++) {
    sum += x[i];
  }
  dp[0][0][0] = 1;
  for (int i = 1; i <= N; i++) {
    for (int k = 0; k <= i; k++) {
      for (int a = 0; a <= sum; a++) {
        dp[i][k][a] += dp[i - 1][k][a];
        if (1 <= k && x[i] <= a) {
          dp[i][k][a] += dp[i - 1][k - 1][a - x[i]];
        }
      }
    }
  }
  long long ret = 0;
  for (int k = 1; k <= N; k++) {
    ret += dp[N][k][A * k];
  }
  std::cout << ret << std::endl;
  return 0;
}
