import itertools
N,A=map(int,input().split())
l=input().split()
ls=[]
a=0
s=1
for i in l:
     ls.append(eval(i))
def fn(ls,s):
     global a
     for i in itertools.combinations(ls,s):
          if sum(i)/s==A:
               a+=1
     if s<N:
          s+=1
          fn(ls,s)
     else:
          print(a)
fn(ls,s)
