fun main(args: Array<String>) {
    val (n, a) = readLine()!!.split(" ").map(String::toInt)
    var dp = Array(n+1, {Array(a*n+1, {0.toLong()})}) 
    var dp_copy = Array(n+1, {Array(a*n+1, {0.toLong()})}) 
    val x = readLine()!!.split(" ").map(String::toInt)
    dp[0][0] = 1.toLong()
    dp_copy[0][0] = 1.toLong()
    for(i in 1..n){
        for(j in 0..n-1){
            for(k in 0..n*a-x[i-1]){
                dp_copy[j+1][k+x[i-1]] += dp[j][k]
            }
        }
        for(j in 0..n){
            for(k in 0..n*a){
                dp[j][k] = dp_copy[j][k]
            }
        }
    }
    var ans = 0.toLong()
    for(i in 1..n) ans += dp[i][i*a]
    println(ans)
}