n,a=map(int,input().split())
x=list(map(int,input().split()))
x.insert(0,0)
dp=[[[0]*(n*a+1) for _ in range(n+1)]for _ in range(n+1)]
dp[0][0][0]=1

for i in range(n+1):
    for j in range(n+1):
        for k in range(n*a+1):
            if  i>=1 and k<x[i]:
                dp[i][j][k]=dp[i-1][j][k]
            elif i>=1 and j>=1 and k>=x[i]:
                dp[i][j][k]=dp[i-1][j][k]+dp[i-1][j-1][k-x[i]]

ans=0
for i in range(1,n+1):
    ans+=dp[n][i][i*a]

print(ans)
