import scala.io.StdIn

object Main {
  def main (args : Array[String]) = {
    val temp = StdIn.readLine().split(' ').map(_.toInt)
    val (n, a) = (temp(0), temp(1))
    val x = StdIn.readLine().split(' ').map(_.toInt)
    val dp = Array.fill[Int](n, n + 1, a * n + 1) { 0 }
    (0 to (n - 1)).foreach(dp(_)(0)(0) = 1)

    dp(0)(1)(x(0)) = 1
    (1 to (n - 1)).foreach ((i) =>
      (1 to n).foreach ((j) =>
        (0 to (a * n)).foreach((k) =>
          if (k >= x(i)) {
            dp(i)(j)(k) = dp(i - 1)(j - 1)(k - x(i)) + dp(i - 1)(j)(k)
          } else {
            dp(i)(j)(k) = dp(i - 1)(j)(k)
          }
        )
      )
    )

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