N,A = map(int, input().split())
x = list(map(int, input().split()))
assert(1<=N<=16)
ans = 0
for i in range(2**N):
    # print(bin(i))
    s = 0
    cnt = 0
    for keta in range(N):
        if (i>>keta)%2==1:
            s += x[keta]
            cnt += 1 
    if cnt==0: continue
    if s/cnt==A:
        ans += 1
print(ans)