n,a = map(int,input().split())
x = list(map(int,input().split()))
for i in range(n):
    x[i] -= a
ans = 0
for i in range(1,2**n):
    b,t,j = i,0,0
    while b > 0:
        if b % 2 != 0:
            t += x[j]
        b = b // 2
        j += 1
    if t == 0:
        ans += 1
print(ans)