import io.{StdIn => in}

object Main extends App {
  val Array(n, a) = in.readLine.split(" ").map(_.toInt)
  val x = in.readLine.split(" ").map(_.toInt).sorted
  val sumMax = math.max(x.max * n, a * n)
  val dp = Array.ofDim[Long](n+1, n+1, sumMax + 1)

  for(i <- 0 to n) dp(i)(0)(0) = 1
  for{
      i <- 1 to n; xi = i - 1
      j <- 1 to n; if j <= i
      k <- 1 to sumMax
    } {
      dp(i)(j)(k) =
        if(k < x(xi)) dp(i-1)(j)(k)
        else dp(i-1)(j)(k) + dp(i-1)(j-1)(k-x(xi))

      // if(k == sumMax) println(i + " " + j + " : " + dp(i)(j).mkString(" "))
    }

  val ans = (1 to n)./:(0L)((acc,j) => {
    // println(n + " " + j +  " " + a*j + " : " + dp(n)(j)(a*j))
    acc + dp(n)(j)(a*j)
  })
  println(ans)
}