
N,A = list(map(int,input().split()))
x = list(map(int,input().split()))

dp = [[[0 for i in range(N+1)] for j in range(N)] for k in range(N*A+1)]
dp[0][0][0] = 1
dp[x[0]][0][1] = 1
for i in range(N-1):
    for j in range(N*A+1):
        if j-x[i+1]>=0:
            for k in range(0,N+1):
                if k!=0:
                    dp[j][i+1][k]=dp[j-x[i+1]][i][k-1]+dp[j][i][k]
                else:
                    dp[j][i+1][k]=dp[j][i][k]
        else:
            for k in range(0,N+1):
                dp[j][i+1][k]=dp[j][i][k]
score = 0

for i in range(N):
    score+=dp[(i+1)*A][N-1][i+1]

print(score)           