object Main extends App {
 
  val Array(n, a) = scala.io.StdIn.readLine().split(" ").map(_.toInt)
  val arr = scala.io.StdIn.readLine().split(" ").map(_.toInt)
  var count = 0L
  (1 to n) foreach { i =>
    val brr = ((1 to n) zip arr).combinations(i)
    brr.foreach { crr =>
      val abe = crr.map(_._2).sum * 1.0 / i
      if (abe == a) {
        count = count + 1
      }
    }
  }
 
  println(count)
 
}