n,a=map(int,input().split())
X=[int(i) for i in input().split()]
DP=[[[0 for i in range(50*n+1)] for i in range(n+1)] for i in range(n+1)]
DP[0][0][0]=1
for i in range(1,n+1):
  for j in range(i+1):
    for s in range(50*j+1):
      DP[i][j][s]=DP[i-1][j][s]+DP[i-1][j-1][s-X[i-1]]
ans=0
for j in range(1,n+1):
  ans+=DP[n][j][j*a]
print(ans)