N,A=map(int,input().split())
x=list(map(int,input().split()))
xx=max(max(x),A)

dp=[[[0]*(N*xx+1) for _ in range(N+1)] for _ in range(N+1)]

for j in range(N+1):
  for k in range(N+1):
    for s in range(N*xx+1):
      if j==k==s==0:
        dp[j][k][s]=1
      elif j>=1 and s<x[j-1]:
        dp[j][k][s]=dp[j-1][k][s]
      elif j>=1 and k>=1 and s>=x[j-1]:
        dp[j][k][s]=dp[j-1][k][s]+dp[j-1][k-1][s-x[j-1]]
      else:
        pass
ans=0
for k in range(1,N+1):
  ans+=dp[N][k][k*A]
print(ans)