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