output_description: Print the number of ways to select cards such that the average of the written
  integers is exactly A.
  
  * * *
input_description: The input is given from Standard Input in the following format:
  
      
      
      N A
      x_1 x_2 ... x_N
attempt: # -*- coding: utf-8 -*-
  import sys
  import math
  import os
  import itertools
  import _collections
  import string
  from functools import lru_cache
  import heapq
  
  
  class cin:
      def int():
          return int(sys.stdin.readline().rstrip())
  
      def string():
          return sys.stdin.readline().rstrip()
  
      def mapInt():
          return [int(x) for x in cin.string().split()]
  
      def stringList(n):
          return [input() for i in range(n)]
  
      def intListList(n):
          return [cin.mapInt() for i in range(n)]
  
      def intColsList(n):
          return [int(input()) for i in range(n)]
  
  
  class Math:
      def gcd(a, b):
          if b == 0:
              return a
          return Math.gcd(b, a % b)
  
      def lcm(a, b):
          return (a * b) // Math.gcd(a, b)
  
      def roundUp(a, b):
          return -(-a // b)
  
      def toUpperMultiple(a, x):
          return Math.roundUp(a, x) * x
  
      def toLowerMultiple(a, x):
          return (a // x) * x
  
      def nearPow2(n):
          if n <= 0:
              return 0
          if n & (n - 1) == 0:
              return n
          ret = 1
          while n > 0:
              ret <<= 1
              n >>= 1
          return ret
  
      def isPrime(n):
          if n < 2:
              return False
          if n == 2:
              return True
          if n % 2 == 0:
              return False
          d = int(n**0.5) + 1
          for i in range(3, d + 1, 2):
              if n % i == 0:
                  return False
          return True
  
  
  MOD = int(1e09) + 7
  
  
  def main():
      N, A = cin.mapInt()
      X = cin.mapInt()
      dp = [[[0 for k in range(3000)] for j in range(51)] for i in range(51)]
      dp[0][0][0] = 1
      ans = 0
      for i in range(N):
          for j in range(i + 1):
              for k in range(2500):
                  dp[i + 1][j][k] += dp[i][j][k]
                  dp[i + 1][j + 1][k + X[i]] += dp[i][j][k]
      for j in range(1, N + 1):
          ans += dp[N][j][j * A]
      print(ans)
      return
  
  
  if __name__ == "__main__":
      main()
  
problem_description: Statement
  
  Tak has N cards. On the i-th (1 \leq i \leq N) card is written an integer x_i.
  He is selecting one or more cards from these N cards, so that the average of
  the integers written on the selected cards is exactly A. In how many ways can
  he make his selection?
samples: [{"input": "4 8\n    7 9 8 9", "output": "5\n    \n\n  * The following are the 5 ways to select cards such that the average is 8:\n    * Select the 3-rd card.\n    * Select the 1-st and 2-nd cards.\n    * Select the 1-st and 4-th cards.\n    * Select the 1-st, 2-nd and 3-rd cards.\n    * Select the 1-st, 3-rd and 4-th cards.\n\n* * *"}, {"input": "3 8\n    6 6 9", "output": "0\n    \n\n* * *"}, {"input": "8 5\n    3 6 2 8 7 6 5 9", "output": "19\n    \n\n* * *"}, {"input": "33 3\n    3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3", "output": "8589934591\n    \n\n  * The answer may not fit into a 32-bit integer."}]