N, A = map(int, input().split())
x = list(map(int, input().split()))
X = max(A, max(x))

DP = [[[0 for _ in range(N*X+1)] for _ in range(N+1)] for _ in range(N+1)]
DP[0][0][0] = 1

for j in range(1, N+1):
    for k in range(j+1):
        for s in range(k*X+1):
            if(s < x[j-1]):
                DP[j][k][s] = DP[j-1][k][s]
            else:
                DP[j][k][s] = DP[j-1][k][s]+DP[j-1][k-1][s-x[j-1]]
ans = 0                
for i in range(1, N+1):
    ans += DP[-1][i][i*A]
print(ans)