N, A = map(int, input().split())
x = list(map(int, input().split()))

ans = 0
for i in range(1 << min(N, 16)):
    total = 0
    cnt = 0
    for j in range(min(N, 16)):
        if i & (1<<j):
            total += x[j]
            cnt += 1
    if cnt != 0 and total / cnt == A:
        ans += 1
print(ans)