def solve():

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

    x = [int(i) for i in input().split()]

 

    # 3d DP

    max_x = max(x)

 

    dp = [[[0] * (max_x * N + 1) for j in range(N + 1)]

                                 for i in range(N + 1)]

 

    dp[0][0][0] = 1

 

    for i in range(0, N):

        for k in range(0, N + 1):

            for y in range(max_x * N + 1):

                if dp[i][k][y]:

                    dp[i + 1][k][y] += dp[i][k][y]

                    dp[i + 1][k + 1][y + x[i]] += dp[i][k][y]

                    

    cnt = 0

    for k in range(1, N + 1):

        for y in range(1, max_x * N + 1):

            if y // k == A and y % k == 0:

                cnt += dp[N][k][y]

 

    print(cnt)

 

if __name__ == '__main__':

    solve()
def solve():

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

    x = [int(i) for i in input().split()]

     

    lim = sum(x)

    dp = [[0]*(lim + 1) for i in range(N + 1)]

     

    dp[0][0] = 1

     

    for i in range(N):

        for k in range(i + 1, 0, -1):

            for v in range(lim, x[i] - 1, -1):

                dp[k][v] += dp[k - 1][v - x[i]]

     

    ans = 0

     

    for k in range(1, N + 1):

        if k*A > lim:

            break

        ans += dp[k][k*A]

     

    print(ans)

 

if __name__ == '__main__':

    solve()
def solve():
    N, A = list(map(int, input().split()))
    x = [int(i) for i in input().split()]
    # 3d DP
    max_x = max(x)
    dp = [[[0] * (max_x * N + 1) for j in range(N + 1)] for i in range(N + 1)]
    dp[0][0][0] = 1
    for i in range(0, N):
        for k in range(0, N + 1):
            for y in range(max_x * N + 1):
                if dp[i][k][y]:
                    dp[i + 1][k][y] += dp[i][k][y]
                    dp[i + 1][k + 1][y + x[i]] += dp[i][k][y]
    cnt = 0
    for k in range(1, N + 1):
        for y in range(1, max_x * N + 1):
            if y // k == A and y % k == 0:
                cnt += dp[N][k][y]
    print(cnt)


if __name__ == "__main__":
    solve()

def solve():
    N, A = list(map(int, input().split()))
    x = [int(i) for i in input().split()]
    lim = sum(x)
    dp = [[0] * (lim + 1) for i in range(N + 1)]
    dp[0][0] = 1
    for i in range(N):
        for k in range(i + 1, 0, -1):
            for v in range(lim, x[i] - 1, -1):
                dp[k][v] += dp[k - 1][v - x[i]]
    ans = 0
    for k in range(1, N + 1):
        if k * A > lim:
            break
        ans += dp[k][k * A]
    print(ans)


if __name__ == "__main__":
    solve()

-    # 3d DP -    max_x = max(x) -    dp = [[[0] * (max_x * N + 1) for j in range(N + 1)] for i in range(N + 1)] -    dp[0][0][0] = 1 -    for i in range(0, N): -        for k in range(0, N + 1): -            for y in range(max_x * N + 1): -                if dp[i][k][y]: -                    dp[i + 1][k][y] += dp[i][k][y] -                    dp[i + 1][k + 1][y + x[i]] += dp[i][k][y] -    cnt = 0 +    lim = sum(x) +    dp = [[0] * (lim + 1) for i in range(N + 1)] +    dp[0][0] = 1 +    for i in range(N): +        for k in range(i + 1, 0, -1): +            for v in range(lim, x[i] - 1, -1): +                dp[k][v] += dp[k - 1][v - x[i]] +    ans = 0 -        for y in range(1, max_x * N + 1): -            if y // k == A and y % k == 0: -                cnt += dp[N][k][y] -    print(cnt) +        if k * A > lim: +            break +        ans += dp[k][k * A] +    print(ans)