n,a=map(int,input().split())
x=list(map(int,input().split()))
x=sorted([x[i]-a for i in range(n)])
dp=[[0]*5001 for i in range(n+1)]
dp[0][2500]+=1
for i in range(n):
    for j in range(5001):
        dp[i+1][j]+=dp[i][j]
        if 0<=j-x[i]<=5000:
            dp[i+1][j]+=dp[i][j-x[i]]
print(dp[-1][2500]-1)