fun main(args: Array<String>) {
  val (n, a) = readLine()!!.split(" ").map { it.toInt() }
  val xs = readLine()!!.split(" ").map { it.toInt() }
  val m = n * xs.max()!!
  val ys = xs.map { it - a }
  var dp = Array<LongArray>(n + 1) { LongArray(2 * m + 1) { 0L } }
  dp[0][m] = 1L
  for (i in 0 until n) {
    for (j in 0..2 * m) {
      dp[i + 1][j] = dp[i][j]
      if (0 <= j - ys[i] && j - ys[i] <= 2 * m) {
        dp[i + 1][j] += dp[i][j - ys[i]]
      }
    }
  }
  println(dp[n][m] - 1)
}
