import java.math.*

fun main(args: Array<String>) {
    val (N, A) = readInputLine().split(" ").map { it.toInt() }
    val xs = readInputLine().split(" ").map { it.toInt() - A }
    
    val dp = Array(N + 1, { LongArray(50 * N) })
    
    dp[0][(A - 1) * N] = 1L
    
    for ((i, x) in xs.withIndex()) {
        for (j in 0 until 50 * N) {
            dp[i + 1][j] = dp[i][j]
        }
        for (j in Math.max(0, -x) until Math.min(50 * N, 50 * N - x)) {
            dp[i + 1][j + x] += dp[i][j]
        }
    }
    
    println(dp[N][(A - 1) * N] - 1L)
}

fun readInputLine(): String {
    return readLine()!!
}
