object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val n, a = sc.nextInt()
  val x = Array.fill(n)(sc.nextInt() - a)

  val dp = Array.fill(n+1, 5001)(-1L)
  for (j <- 0 to 5000) {
    dp(0)(j) = 0
  }
  dp(0)(2500) = 1

  def solve(i: Int, j: Int): Long = {
    if (dp(i)(j) != -1) {
      dp(i)(j)
    } else {
      val ans = solve(i-1, j) + solve(i-1, j - x(i-1))
      dp(i)(j) = ans
      ans
    }
  }

  println(solve(n, 2500) - 1)
}
