import java.util.*

fun main(args: Array<String>) {
    val sc = Scanner(System.`in`)
    val N = sc.nextInt()
    val A = sc.nextInt()
    val x = (1..N).map { sc.nextInt() }
    val size = N * 2 * 50 + 2
    val dp = Array(N + 1) { Array(size) {0L} }
    val base = N * 50 + 1
    dp[0][base] = 1

    for (i in 0 until N) {
        for (j in 0 until size) {
            if (dp[i][j] == 0L) {
                continue
            }
            dp[i + 1][j] += dp[i][j]
            dp[i + 1][j + x[i] - A] += dp[i][j]
        }
    }
    println(dp[N][base] - 1)
}