fun main(args: Array<String>) {
    val (n, a) = readLine()!!.split(" ").map(String::toInt)
    val x = readLine()!!.split(" ").map(String::toInt)
    val an = a * n
    val mm = Array(n + 1) {
        Array(n + 1) { LongArray(an + 1) }
    }
    for (i in 0..n) {
        for (j in 0..n) {
            for (k in 0..an) {
                mm[i][j][k] = when {
                    i == 0 && j == 0 && k == 0 -> 1L
                    1 <= i && k < x[i - 1] -> mm[i - 1][j][k]
                    1 <= i && 1 <= j && x[i - 1] <= k -> mm[i - 1][j][k] + mm[i - 1][j - 1][k - x[i - 1]]
                    else -> 0L
                }
            }
        }
    }
    var result = 0L
    for (i in 1..n) {
        result += mm[n][i][a * i]
    }
    println(result)
}
