n, a = [int(i) for i in input().split()]
x = [0]
for i in input().split():
    x.append(int(i))

dp = [[[0 for i in range(50 * 50 + 1)] for j in range(n + 1)] for k in range(n + 1)]
dp[0][0][0] = 1
for i in range(1, n + 1):
    for j in range(0, n + 1):
        for s in range(50 * 50):
            if j > i:
                continue
            if (i == 0) & (j == 0) & (s == 0):
                continue
            if (i > 0) & (s < x[i]):
                dp[i][j][s] = dp[i - 1][j][s]
            elif (i > 0) & (j > 0) & (s >= x[i]):
                dp[i][j][s] = dp[i - 1][j][s] + dp[i - 1][j - 1][s - x[i]]

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

print(sum)