import itertools

def bit(n, m):
    bit_list = list(itertools.product([i for i in range(m)], repeat=n))
    return bit_list

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

bits = bit(N,2)
res = 0

for i in bits:
    tmp = 0
    if sum(i) == 0:
        continue

    for j in range(N):
        if i[j] == 1:
            tmp += X[j]
    
    if tmp/i.count(1) == A:
        res += 1


print(res)

