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

# dp[i][k][j]
# i枚の中から、k枚選んで、和がj
dp = [[[0 for j in range(2501)]for k in range(n+1)] for i in range(n+1)]

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

for i in range(1,n+1):
    for k in range(1,n+1):
        for j in range(2501):
            if j-x[i-1]>=0:
                dp[i][k][j]=dp[i-1][k-1][j-x[i-1]]+dp[i-1][k][j]
            else:
                dp[i][k][j]=dp[i-1][k][j]

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


print(ans)