function Main(input) {
  let lines = input.split('\n');
  let tmp = lines[0].split(' ');

  let N = parseInt(tmp[0]);
  let A = parseInt(tmp[1]);

  let x = lines[1].split(' ').map((n) => parseInt(n));

  let dp = new Array(N + 1).fill(() =>
    new Array(N + 1).fill(() => new Array(N * A + 1).fill(0))
  );

  for (let i = 0; i < N; ++i) dp[i][0][0] = 1;

  for (let i = 1; i <= N; ++i) {
    for (let j = 1; j <= i; ++j) {
      for (let k = 1; k <= A * N; ++k) {
        if (k < x[i]) {
          dp[i][j][k] = dp[i - 1][j][k];
        } else {
          dp[i][j][k] = dp[i - 1][j][k] + dp[i - 1][j - 1][k - x[i]];
        }
      }
    }
  }

  let ans = 0;
  for (let j = 1; j <= N; ++j) {
    ans += dp[N][j][j * A];
  }

  console.log(ans);
}

Main(require('fs').readFileSync('/dev/stdin', 'utf8'));
