N, A = map(int, input().split())
*X, = map(int, input().split())
MAX = max(max(X), A) * N
X = [x - A for x in X]

dp = {i: {j: 0 for j in range(2*MAX+1)} for i in range(N+1)}
dp[0][MAX] = 1
for i in range(1, N+1):
    for j in range(2*MAX+1):
        t = j - X[i-1]
        dp[i][j] = dp[i-1][j] + (dp[i-1][t] if 0 <= t <= 2*MAX else 0)
print(dp[N][MAX]-1)