fun main(args: Array<String>) {
    val (N, A) = readLine()!!.split(" ").map { it.toInt() }
    val x = readLine()!!.split(" ").map { it.toLong() }.toLongArray()
    val max = 50 * 50
    val dp = Array(N + 1) { Array(N + 1, { LongArray(max + 1, { 0}) })}
    for (i in 0..N) {
        dp[i][0][0] = 1
    }

    for (i in 1..N) {
        for (k in 1..N) {
            for (j in 0..max) {
                dp[i][k][j] =
                                dp[i - 1][k][j] +
                        dp[i-1][k-1].getOrElse((j - x[i-1]).toInt(), { 0 })
            }
        }
    }

    var answer = 0L
    for (i in 1..N) {
        val trg = A * i
        answer += dp[N][i][trg]
    }

    println(answer)
}