import itertools
n,a=map(int,input().split())
x=list(map(int,input().split()))
pd=list(itertools.product(range(2),repeat=n))
pd=pd[1:]
ans=0
for l in pd:
    c=0
    s=0
    for i in range(n):
        if l[i]==1:
            c+=1
            s+=x[i]
    if s/c==a:
        ans+=1
print(ans)