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

ans = 0
for i in range(1<<n):
    sum1 = 0
    cnt = 0
    for j in range(n):
        if i>>j&1:
            cnt +=1
            sum1 +=L[j]
    if cnt != 0:
        if sum1/cnt == a:
            ans +=1
print(ans)