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

M = 50

dp = [[0] * (M * M + 1) for _ in range(N + 1)]
dp[0][0] = 1

for i, a in enumerate(X):
    for n in range(M * M):
        dp[i + 1][n] = dp[i][n]
        if 0 <= n - a and n - a <= M * M - 1:
            dp[i + 1][n] += dp[i][n - a]

# print(dp[N][N * A])

ans = 0
for a in range(A,A*N+1,A):
    ans += dp[N][a]
    # print("{}   {},{}".format(dp[N][a], N,a))

# for d in dp:
#     print(sum(d))

# print(dp[N])

print(ans)