n, a = map(int, input().split())
x = [int(i) for i in input().split()]
ans = 0
aaa = []
for i in range(1, (2**n)+1):
    bin_i = list(bin(i)[2:])
    if len(bin_i) < n:
        bin_i = ["0"] * (n - len(bin_i)) + bin_i
    t = []
    for j, bbb in enumerate(bin_i):
        if bbb == "1":
            t.append(x[j])
    if (sum(t) % len(t) == 0) & (sum(t) // len(t) == a):
        ans += 1
        aaa.append(i)
print(ans)