N,A = map(int,input().split())
X = list(map(int,input().split()))
dp = [[[0 for _ in range(2501)] for _ in range(N+1)] for _ in range(N+1)]
for i in range(N+1):
    dp[i][0][0] = 1
for i in range(1,N+1):
    for j in range(1,N+1):
        for k in range(1,2501):
            dp[i][j][k] = dp[i-1][j][k]
            if k>=X[i-1]:
                dp[i][j][k] += dp[i-1][j-1][k-X[i-1]]
cnt = 0
for j in range(1,N+1):
    cnt += dp[N][j][j*A]
print(cnt)