fun main(args: Array<String>) {
    val (n, a) = readLine()!!.split(' ').map(String::toInt)
    val x = readLine()!!.split(' ').map(String::toInt)
    val dp = Array(n + 1) { LongArray(50 * n + 1) { 0L } }
    dp[0][0] = 1
    for (i in 0 until n)
        for (j in i downTo 0)
            for (k in 0..(50 * i))
                dp[j + 1][k + x[i]] += dp[j][k]

    var ans: Long = 0
    for (i in 1..n)
        ans += dp[i][i * a]
    println(ans)
}