n,a=map(int,input().split())
X=list(map(int,input().split()))
m=max(X)
Y=map(lambda x:x-a,X)
DP=[[0]*(2*m*n+1) for _ in range(n+1)]
DP[0][m*n]=1
for i,y in enumerate(Y):
    for j in range(2*m*n+1):
        DP[i+1][j]=DP[i][j]
        if 0<=j-y<=2*m*n:
            DP[i+1][j]+=DP[i][j-y]
print(DP[n][m*n]-1)