n,a=map(int,input().split())
l=list(map(int,input().split()))
dp=[0]*5300
dp[l[0]-a]=1

for x in l[1:]:
  b=x-a
  if b>=0:
    for i in range(2500,-2501,-1):
      dp[i+b]+=dp[i]
  else:
    for i in range(-2500,2501):
      dp[i+b]+=dp[i]
  dp[b]+=1
print(dp[0])