n, a = map(int, input().split())
x_array = sorted([int(x) for x in input().split()], reverse=True)
res = 0
for i in range(2 ** n):
    bit = bin(i)
    one = bit.count("1")
    tmp = 0
    for j in range(n):
        if (i >> j) & 1:
            tmp += x_array[j]
    if tmp == one*a and one != 0:
        res += 1
print(res)
