n, a = map(int, input().split())
x = list(map(int, input().split()))
y = [v-a for v in x]

dp = [[0] * 5000 for _ in range(n+1)]
zero = 2500
dp[0][zero] = 1
for i in range(n):
    for j in range(5000):
        dp[i+1][j] += dp[i][j]
        if j + y[i] < 5000:
            dp[i+1][j+y[i]] += dp[i][j]

print(dp[n][zero] - 1)