import scala.io.Source

object Wandbox extends App {
    val xs = Source.stdin.getLines()
    val Array(n, a) = xs.next().split(' ').map(_.toInt)
    val ds = xs.next().split(' ').map(_.toInt)
    
    println(solve(n, a, ds))
    
    def solve(n: Int, a: Int, ds: Seq[Int]): String = {
        var c = 0
        
        powerset(ds).foreach { dss =>
            val avg = if (dss.length > 0) {
                if (dss.sum % dss.length == 0) {
                    dss.sum / dss.length
                } else {
                    -1
                }
            } else {
                -1
            }
            c = c + (if (avg == a) 1 else 0)
        }
        
        c.toString
    }
    
    def powerset[T](xss: Seq[T]): Seq[Seq[T]] = {
        xss match {
            case Nil =>
                Seq(Seq.empty[T])
            case x +: xs =>
                val qs = powerset(xs)
                val rs = for (ps <- qs) yield x +: ps
                rs ++: qs
        }
    }
}
