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

ans = [[0]*5001 for _ in range(n)]  # -2500 ~ 2500

for i in range(n):
    if i == 0:
        ans[0][x[i]+2500] += 1
    else:
        for j in range(5001):
            if 5000 >= j-x[i] >= 0:
                ans[i][j] = ans[i-1][j] + ans[i-1][j-x[i]]
        ans[i][x[i]+2500] += 1

print(ans[n-1][2500])