N, A = map(int, input().split())
X = list(map(lambda x: int(x)-A, input().split()))
X_MAX = max(max(X), -min(X))
NX = N * X_MAX
dp = [[[0] * (N+1)  for i in range(N+1)] for _ in range(NX * 2 + 1)]
dp[NX][0][0] = 1
for i in range(1, N+1):
    for j in range(0, i+1):
        for k in range(NX * 2 + 1):
            if k == NX and j == 0:
                dp[k][i][j] = 1
                continue
            dp[k][i][j] += dp[k][i-1][j]
            if 0 <= k - X[i-1] < NX * 2 + 1:
                dp[k][i][j] += dp[k-X[i-1]][i-1][j-1]

print(sum(dp[NX][N]) - 1)