n,a = map(int, input().split())
x = list(map(int, input().split()))
for i in range(n):
    x[i] -= a
lis = []
for i in range(2**n):
    d = list(map(int, list(bin(i))[2:]))
    while len(d) < n:
        d.insert(0,0)
    lis.append(d)
ans = -1
for i in lis:
    su = 0
    for j in range(n):
        su += i[j]*x[j]
    if su == 0:
        ans += 1
print(ans)