n,a=map(int,input().split())
l=list(map(int,input().split()))
count=0

for i in range(2**n):
    s=0
    hg=0
    for j in range(n):
        if (i>>j)&1==1:
            s=s+l[j]
            hg=hg+1
    if s==hg*a and hg!=0:
        count=count+1
print(count)