import java.util.*

fun main(args:Array<String>){
    val (n,a) = readLine()!!.split(" ").map{it.toInt()}
    val x = readLine()!!.split(" ").map{it.toInt()}
    val dp = Array(60){Array(60){LongArray(3000) } }
    dp[0][0][0] = 1
    for(i in 0 until n){
        for(j in 0 .. 50){
            for(k in 0 .. 2500){
                if(j > 0 && k >= x[i]) dp[i + 1][j][k] += dp[i][j - 1][k - x[i]]
                dp[i + 1][j][k] += dp[i][j][k]
            }
        }
    }
    var ans = 0L
    for(i in 1 .. 50){
        ans += dp[n][i][i * a]
    }
    println(ans)
}
