function Main(s) {
  s[0] = s[0].split(" ").map(a => parseInt(a));
  var n = s[0][0];
  var a = s[0][1];
  var x = s[1].split(" ").map(a => parseInt(a));
  var b = Array(2).fill(0).map(a => Array(n + 1).fill(0).map(a => Array(50 * n + 1).fill(0)));
  var ans = 0;
  b[0][0][0] = 1;
  for(var i = 1; i <= n; i++){
    b[i&1][0][0] = 1;
    for(var j = 1; j <= i; j++){
      for(var k = 0; k <= j * 50; k++){
        b[i&1][j][k] = b[(i+1)&1][j][k];
        if(k >= x[i-1])b[i&1][j][k] += b[(i+1)&1][j-1][k-x[i-1]];
      }
    }
  }
  for(var j = 1; j <= n; j++){
    ans += b[n&1][j][j*a];
  }
  console.log(ans);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8").split("\n"));