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

ans = 0
for i in range(2**N):
    tmp = 0 
    for j in range(N):
        if (i>>j)&1:
            tmp+=X[j]       
    if tmp==0:      
        ans += 1
print(ans-1)
