N,A = map(int,input().split())
x = list(map(int,input().split()))
ans = 0
for i in range(2**N):
    b = [i>>j&1 for j in range(N)]
    sum = 0
    count = 0
    for j in range(N):
        if b[j] == 1:
            sum += x[j]
            count += 1
    if count > 0 and sum%count==0 and sum // count == A:
        ans += 1
print(ans)