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

memo = {0:1}
for x in X:
    for k, v in list(memo.items()):
        memo[x + k] = memo.get(x + k, 0) + v

print(memo[0] - 1)
