import java.util.Scanner

object Main {
  def main(args: Array[String]): Unit = {
    val sc = new Scanner(System.in)
    val N, A = sc.nextInt

    val x = List.fill(N)(sc.nextInt)

    var count:Long = 0
    for(i <- 0 until (1 << N)) {
      val list = x.zipWithIndex.filter{
        case (v, j) => (i >> j) % 2 == 0
      }.map{
        case (v, j) => v
      }

      if(list.nonEmpty && (list.sum.toFloat / list.length) == A){
        count+= 1
      }
    }

    println(count)
  }
}
