n,a=list(map(int,input().split()))
x=list(map(lambda x:int(x)-a,input().split()))
d={0:1}
for i in range(n):
  nd={}
  for j in d:
    if j in nd:
      nd[j]+=d[j]
    else:
      nd[j]=d[j]
    if (j+x[i]) in nd:
      nd[j+x[i]]+=d[j]
    else:
      nd[j+x[i]]=d[j]
  d=nd
print(d[0]-1)