n,a=map(int,input().split())
x=sorted(list(map(int,input().split())))
for i in range(n):
    x[i]-=a
cnt=0
for i in range(2**n):
    ans=0
    for j in range(n):
        if ((i>>j)&1):
            ans+=x[j]
    if ans==0:
        cnt+=1
print(cnt-1)