N,A=map(int,input().split())
a=list(map(int, input().split()))
def hiku(kazu):
    return kazu-A
b=[]
for i in range(N):
    b.append(hiku(a[i]))
X=max(a)
def hai(s,t):
    if s==0 and t==NX:
        return 1
    elif s>=1 and (t-b[s]<0 or t-b[s]>2NX):
        return hai(s-1,t)
    elif s>=1 and (0<=t-b[s]<=2NX):
        return hai(s-1,t)+hai(s-1,t-b[s])
    else:
        return 0
print(hai(N,NX)-1)