N,A = map(int,input().split())
card_num = [i for i in map(int,input().split())]

ans = 0 
for i in range(2**N): 
    total = 0
    cnt = 0
    for j in range(N):
        if (i >> j) & 1 :
            cnt += 1
            total += card_num[j]
    
    if cnt != 0 :
        if total / cnt == A :
            ans += 1
print(ans)