n,a = map(int,input().split())
x = list(map(int,input().split()))
ans = 0
for i in range(2 ** n):
    tmp = []
    for j in range(n):
        if ((i >> j) & 1):
            tmp.append(x[j])
    if len(tmp) > 0:
        if sum(tmp) / len(tmp) == a:
            ans += 1
print(ans)