from itertools import combinations
n,a=map(int,input().split())
x=list(map(int,input().split()))
ans=0
for i in range(1,n+1):
    li=list(combinations(x,i))
    for d in li:
        if sum(d)==a*i:
            ans+=1
print(ans)