object Main {
  def main(args:Array[String]) = {
    val sc = new java.util.Scanner(System.in)
    val n, a = sc.nextInt
    val x = List.fill(n)(sc.nextInt)

    val nx = (a :: x).max * n

    val dp = collection.mutable.ArrayBuffer.fill(n + 1, n + 1, nx + 1)(-1L)
    def dpFunc(j: Int, k: Int, s: Int): Long = {
    	if (dp(j)(k)(s) >= 0) return dp(j)(k)(s)

    	val ret = if (j == 0 && k == 0 && s == 0) 1L
    		else if (j > 0 && s < x(j - 1)) dpFunc(j - 1, k, s)
    		else if (j > 0 && k > 0 && s >= x(j - 1)) dpFunc(j - 1, k, s) + dpFunc(j - 1, k - 1, s - x(j - 1))
    		else 0L
    	dp(j)(k)(s) = ret
    	ret
    }

    val ans = (1 to n).map(k => dpFunc(n, k, k * a)).sum

    println(ans)

  }
}