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: n, a = map(int, input().split())
  x = list(map(int, input().split()))
  
  x_m = []
  x_0 = []
  x_p = []
  for i in range(n):
      tmp = x[i] - a
      if tmp < 0:
          x_m.append(tmp * -1)
      elif tmp == 0:
          x_0.append(tmp)
      else:
          x_p.append(tmp)
  
  len_m = len(x_m)
  len_0 = len(x_0)
  len_p = len(x_p)
  
  dp_m = [[0] * 1300 for i in range(len_m + 1)]
  dp_p = [[0] * 1300 for i in range(len_p + 1)]
  
  dp_m[0][0] = 1
  dp_p[0][0] = 1
  
  
  for i in range(1, len_m + 1):
      for j in range(1300):
          dp_m[i][j] = dp_m[i - 1][j]
          if j >= x_m[i - 1]:
              dp_m[i][j] += dp_m[i - 1][j - x_m[i - 1]]
  
  for i in range(1, len_p + 1):
      for j in range(1300):
          dp_p[i][j] = dp_p[i - 1][j]
          if j >= x_p[i - 1]:
              dp_p[i][j] += dp_p[i - 1][j - x_p[i - 1]]
  
  ans = 0
  for i in range(0, 1300):
      ans += dp_m[-1][i] * dp_p[-1][i]
  
  ans = ans * 2**len_0 - 1
  
  print(ans)
  
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."}]