import scala.io.StdIn

object Main {

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

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

    var count = 0
    (1 to xs.length).foreach { i =>
      xs.combinations(i).foreach { cb =>
        if (cb.map(_._1).sum.toDouble / i == a) {
          count += 1
        }
      }
    }

    println(count)
  }

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