n,a=map(int,input().split())
#i番目までのカードのうちj枚を足して数ｓのものを作る方法をリストにメモ計画法で治める
lists=list(map(int,input().split()))
x=max(max(lists),a)
anslist=[[[ 0 for _ in range(n*x+1)] for _ in range(n+1)]for _ in range(n+1)]
for  j in range(n+1):
    for k in range(n+1):
        for s in range(n*x+1):
            if j==0 and  k==0 and s==0:
                anslist[0][0][0]=1
            elif j>=1 and s<lists[j-1]:
                anslist[j][k][s]=anslist[j-1][k][s]
            elif j>=1 and k>=1 and s>=lists[j-1] :
                anslist[j][k][s]=anslist[j-1][k][s]+anslist[j-1][k-1][s-lists[j-1]]
            else:
                pass
ans=0
for i in range(1,n+1):
    ans+=anslist[n][i][i*a]
print(ans)