import java.util.Arrays

const val MOD: Long = (1e9+7).toLong()

fun main(args: Array<String>) {
    val (n, a) = readLine()!!.split(" ").map{it.toInt()}
    val x = readLine()!!.split(" ").map{it.toInt()}
    val max = 50*n

    val dp = Array(n+1, {Array(n+1, {Array(max+1, {0L})})})
    dp[0][0][0] = 1L
    for (i in 1..n) {
        for (j in 0..n) {
            for (k in 0..max) {
                if ((k < x[i-1]) or (j == 0)) {
                    dp[i][j][k] += dp[i-1][j][k]
                } else {
                    dp[i][j][k] += dp[i-1][j][k] + dp[i-1][j-1][k-x[i-1]]
                }
            }
        }
    }

    var res = 0L
    for (j in 1..n) {
        res += dp[n][j][a*j]
    }
    println(res)
}
