n,a = map(int,input().split())
x = list(map(int,input().split()))
ans = 0
for bit in range(2**n-1):
    x_sum = 0
    count = 0
    for j in range(n):
        if bit>>j&1:
            x_sum += x[j]
            count += 1
    if count > 0:
        if x_sum == a*count:
            ans += 1
print(ans)