n, a = map(int, input().split())
x = list(map(int, input().split()))

x = sorted(x)

ans = 0
for i in range(n):
    x[i] -= a
    if x[i] == 0:
        ans += 1

if x[0] >= 0 or x[n - 1] <= 0:
    print(2 ** ans - 1)
    exit()

ans = 0

def adder(temp_sum, i):
    if i >= n:
        return
    else:
        if temp_sum + x[i] == 0:
            global ans
            ans += 1
        adder(temp_sum, i + 1)
        adder(temp_sum + x[i], i + 1)

adder(0,0)

print(ans)
