object Main extends App {

  import scala.io.StdIn._

  val Array(n, a) = readLine().split(' ').map(_.toInt)
  val values = readLine().split(' ').map(_.toInt).map(_ - a).toList
  def table : Map[Int, Long] ={
    def hoge(current: Map[Int, Long], values: List[Int]): Map[Int, Long]= {

      def withValue(n: Int) = {
        val newKeys = current.keySet ++ current.keySet.map(_ + n)
        newKeys.map{k => k -> (current.getOrElse(k , 0L) + current.getOrElse(k - n, 0L))}.toMap
      }

      values match  {
        case Nil => current
        case x :: remain =>  hoge(withValue(x),remain)
      }
    }
    hoge(Map(0 -> 1L), values)
  }
  val answer = table(0) - 1

  println(answer)
}