object Main {
  def main(args:Array[String]) = {
    val sc = new java.util.Scanner(System.in)
    val n, a = sc.nextInt
    val x = List.fill(n)(sc.nextInt)

    var ans: Long = 0

    for (m <- 1 to n) {
    	Bits.combination(n, m) { bits =>
    		val sum = (0 until n).map { i =>
    			if (bits.test(i)) x(i) else 0
    		}.sum

    		val count = (0 until n).count(i => bits.test(i))

    		if (sum == a * count) ans += 1
    	}
    }

    println(ans)
  }

  case class Bits(x: Int) {
	  // ビットのテスト
	  def test(n: Int): Boolean = (x & (1 << n)) != 0

	  // ビットセット
	  def set(n: Int): Bits = Bits(x | (1 << n))

	  // ビットクリア
	  def clear(n: Int): Bits = Bits(x & ~(1 << n))

	  // n番目以前のビットを立てる
	  def setUntil(n: Int): Bits = Bits(x | ((1 << n) - 1))
	}

	object Bits {
		// n個からm個選ぶ組み合わせ
		def combination(n: Int, m: Int, bits: Bits = Bits(0))(f: Bits => Unit): Unit = {
			if (m == 0) f(bits)
			else if (m == n) f(bits.setUntil(m))
			else {
				combination(n - 1, m, bits)(f)
				combination(n - 1, m - 1, bits.set(n - 1))(f)
			}
		}
	}
}