import sys
input=sys.stdin.readline

n,a=map(int,input().split())
x=list(map(int,input().split()))

dp=[[[0]*(n+1) for i in range(2501)] for j in range(n+1)]

dp[0][0][0]=1

for i in range(n):
    for j in range(2501):
        for k in range(n+1):
            dp[i+1][j][k]+=dp[i][j][k]
            if j+x[i]<=2500 and k+1<=n:
                dp[i+1][j+x[i]][k+1]+=dp[i][j][k]

ans=0
for j in range(1,2501):
    for k in range(1,n+1):
        if a*k==j:
            ans+=dp[n][j][k]

print(ans)