f = lambda: list(map(int,input().split()))

n,a = f()
x = [int(x)-a for x in input().split()]
w = max(max(x),abs(min(x)),a)*n
dp = [[0 for _ in range(2*w + 1)] for _ in range(n+1)]
dp[0][w] = 1
for i in range(n):
    for j in range(2*w + 1):
        if 0 <= j-x[i] <= 2*w:
            dp[i+1][j] = dp[i][j-x[i]] + dp[i][j]
        else:
            dp[i+1][j] = dp[i][j]

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