n,a=map(int,input().split())
x=list(map(int,input().split()))
s=n*a
dp=[[[0 for i in range(s+1)] for j in range(n+1)] for k in range(n+1)]
dp[0][0][0]=1
for i in range(n):
  for j in range(i+2):
    for k in range(s+1):
      if(k>=x[i]):
        dp[i+1][j][k]=dp[i][j-1][k-x[i]]+dp[i][j][k]
      else:
        dp[i+1][j][k]=dp[i][j][k]
outp=0
for i in range(1,n+1):
  outp+=dp[n][i][i*a]
print(outp)