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

# DPテーブルを初期化
dp = [[0] * (50*N+1) for x in range(N+1)]
dp[0][0] = 1

# ループを回す
for i in range(N):
    for k in range(N, 0, -1):
        for pt in range(50*N, 0, -1):
            if pt >= X[i]:
                dp[k][pt] += dp[k-1][pt-X[i]]

# print(dp[3])

ans = 0
for i in range(1, N+1):
    ans += dp[i][A*i]
print(ans)
