n,a=map(int,input().split())
x=list(map(int,input().split()))
for i in range(n):
  x[i]-=a
dp=[]
for i in range(n+1):
  dp.append([])
  for i in range(6000):
    dp[-1].append(0)
dp[0][3000]=1
for i in range(n):
  for j in range(6000):
    if j+x[i]<6000 and j+x[i]>=0:
      dp[i+1][j+x[i]]+=dp[i][j]
      dp[i+1][j]+=dp[i][j]
print(dp[n][3000]-1)
