# 作れる数の最大は50 * 50 = 2500
# dp[i][j] = i枚使ってjを作れる場合の数

import sys
readline = sys.stdin.readline

N,A = map(int,readline().split())
X = list(map(int,readline().split()))

dp = [[0] * 2501 for i in range(N + 1)]
dp[0][0] = 1

for x in X:
  for i in range(len(dp) - 2, -1, -1):
    for j in range(len(dp[i]) - 1, -1, -1):
      if dp[i][j] == 0:
        continue
      dp[i + 1][j + x] += dp[i][j]
      
ans = 0
for i in range(1, len(dp)):
  for j in range(len(dp[i])):
    if j == i * A:
      ans += dp[i][j]
      
print(ans)