import scala.io.StdIn

object Main {

  def main(args: Array[String]): Unit = {

    val Array(n, a) = readIntArray()
    val xs = readIntArray().map(_.toLong).toVector

//    val memos = mutable.Map.empty[(Long, Long), Long]

    def solve(ys: Seq[Long]): Long = {
      ys match {
        case Nil =>
          0L
        case head +: Nil =>
          if (head == a) 1L else 0L
        case head +: tail =>
//          println(s"--- head : ${head}")
          var count = 0
          (1 to tail.length).foreach { i =>
            tail.combinations(i).foreach { cb =>
//              println(s"${i} : ${cb}")
              if ((cb.sum + head).toDouble / (1 + i) == a) {
                count += 1
              } else if (cb.sum.toDouble / i == a) {
                count += 1
              }
            }
          }
          if (head == a) {
            count += 1
          }
//          println(s"::: count : ${count}")
          solve(tail) + count
      }
    }

    println(solve(xs))
  }

  private def readIntArray(): Array[Int] =
    StdIn.readLine().trim.split(' ').filter(_.nonEmpty).map(_.toInt)
}
