import scala.io.StdIn

object Main {

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

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

    val alreadyComputed = collection.mutable.Set.empty[Seq[(Long, Int)]]

    def solve(ys: Seq[(Long, Int)]): Long = {
      ys match {
        case Nil =>
          0L
        case head +: Nil =>
          if (head._1 == a && !alreadyComputed(Seq(head))) 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.map(_._1).sum + head._1).toDouble / (1 + i) == a && !alreadyComputed(head +: cb)) {
                count += 1
                alreadyComputed += (head +: cb)
              } else if (cb.map(_._1).sum.toDouble / i == a && !alreadyComputed(cb)) {
                count += 1
                alreadyComputed += cb
              }
            }
          }
//          println(s"::: count : ${count}")
          solve(tail) + count
      }
    }

    println(solve(xs))
  }

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