import scala.io.StdIn._
import scala.collection.mutable

object Main extends App {
  val Array(n, a) = readLine().split(' ').map(_.toInt)
  val values = readLine().split(' ').map(_.toInt).map(_ - a).toList

  val table = values.foldLeft(mutable.Map(0 -> 1L)) { (table, n) =>
    table.clone().foreach { case (k , v) => table.update(k + n, table.getOrElse(k + n, 0L) + v ) }
    table
  }

  println(table(0) - 1)
}