N,A = map(int,input().split())
x = list(map(int,input().split()))
dp = [[[0]*(N*50+1) for _ in range(N+1)] for _ in range(N+1)]
dp[0][0][0] = 1
#print(dp[0])

for i in range(N):
    for j in range(N):
        for k in range(N*50+1):
            if k+x[i] < N*50+1:
                dp[i+1][j+1][k+x[i]] += dp[i][j][k]
                dp[i+1][j][k] += dp[i][j][k]

#print(dp)
ans = 0
for j in range(1,N+1):
    ans += dp[N][j][A*j]
    #print(j,A*j)
print(ans)