import numpy as np

N, A = [int(v) for v in input().split()]
X = [0, ] + [int(v) for v in input().split()]
mx = sum(X)

dp = np.zeros((N + 1, N + 1, mx + 1))
dp[0][0][0] = 1

for j in range(1, N + 1):
    for k in range(N + 1):
        for s in range(mx + 1):
            if s - X[j] < 0:
                dp[j][k][s] += dp[j - 1][k][s]
            elif k > 0:
                dp[j][k][s] += dp[j - 1][k - 1][s - X[j]] + dp[j - 1][k][s]
                # print('err')  # for debug
            else:
                dp[j][k][s] = 0

ans = 0
# print(dp)
i = 1
while i * A <= sum(X):
    # print(i * A, dp[N, i, i * A].sum())
    ans += dp[N, i, i * A].sum()
    i += 1
print(int(ans))
