# ARC060A

import itertools

n, a = map(int, input().split())
x = list(map(int, input().split()))

# n, a = 33, 3
# x = [3] * 33

count = 0
bin = list(itertools.product([0, 1], repeat=n))
for i in bin:
    s = 0
    m = sum(i)
    if m:
        for j in range(n):
            if i[j] == 1:
                s += x[j]
        # print(s, i)
        if s / m == a:
            count += 1
print(count)
