fun main() {
    val MAX=2501
    val (n,a)= readLine()!!.split(" ").map { it.toInt() }
    val x= readLine()!!.split(" ").map { it.toInt() }.toIntArray()
    var dp=Array(n+1){Array(n+1){IntArray(MAX){0} } }
    dp[0][0][0]=1
    for (i in 0 until n){
        for (j in 0 until n){
            for (k in 0 until MAX){
                dp[i+1][j][k]+=dp[i][j][k]
            }
        }
        for (j in 0 until n){
            for (k in 0 until MAX-x[i]){
                dp[i+1][j+1][k+x[i]]+=dp[i][j][k]
            }
        }
    }
    var ans=0L
    for (i in 1..n){
        ans+=dp[n][i][i*a]
    }
    println(ans)
}