n,a=map(int,input().split())
x=list(map(int,input().split()))
X=[x[i]-a for i in range(n)]
ans=0
for i in range(2**n):
    a=0
    s=i
    l=[0]*n
    for j in range(n):
        l[j]+=s//(2**(n-1-j))
        s-=(s//(2**(n-1-j)))*(2**(n-1-j))
    for j in range(n):
        if l[j]==1:
            a+=X[j]
    if a==0:
        ans+=1
print(ans-1)