import java.io.BufferedReader
import java.io.InputStream
import java.io.InputStreamReader
import java.io.PrintWriter
import java.util.*

fun PrintWriter.solve(sc: FastScanner) {
    val n = sc.nextInt()
    val a = sc.nextInt()
    val x = Array(n) { sc.nextInt() }
    val size = 50 * n + 1
    var dp = Array(n+1) { Array(size) { 0 } }
    dp[0][0] = 1
    for (i in 0 until n) {
        val newdp = Array(n+1) { Array(size) { 0 } }
        for (j in 0..n) {
            for (k in 0 until size) {
                if (j > 0 && k >= x[i]) {
                    newdp[j][k] = dp[j][k] + dp[j - 1][k - x[i]]
                } else {
                    newdp[j][k] = dp[j][k]
                }
            }
        }
        dp = newdp
    }
    var ans = 0L
    for (i in 1..n) {
        if (i * a >= size) break
        ans += dp[i][i * a]
    }
    println(ans)
}

fun main() {
    val writer = PrintWriter(System.out, false)
    writer.solve(FastScanner(System.`in`))
    writer.flush()
}

class FastScanner(s: InputStream) {
    private var st = StringTokenizer("")
    private val br = BufferedReader(InputStreamReader(s))

    fun next(): String {
        while (!st.hasMoreTokens()) st = StringTokenizer(br.readLine())

        return st.nextToken()
    }

    fun nextInt() = next().toInt()
    fun nextLong() = next().toLong()
    fun nextLine() = br.readLine()
    fun nextDouble() = next().toDouble()
    fun ready() = br.ready()
}
