n, a = list(map(int, input().split()))

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





def ave_comb(v_max, ave):

    dp = [[[0 for c in range(n*v_max+1)] for b in range(n+1)] for a 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, i+1):

            for k in range(1, n*v_max+1):

                if k - x[i-1] >= 0:

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

                else:

                    dp[i][j][k] = dp[i-1][j][k]



    ans = 0

    for t in range(1, n+1):

        ans += dp[n][t][ave*t]



    return ans





def main():

    x_max = max(max(x), a)



    print((ave_comb(x_max, a)))





if __name__ == '__main__':

    main()

n, a = list(map(int, input().split()))

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



x_max = max(x)

y = [i-a for i in x]





def ave_comb():

    dp = [[0 for d in range(2*n*x_max+1)] for c in range(n+1)]

    for i in range(n+1):

        dp[i][n*x_max] = 1



    for i in range(1, n+1):

        for j in range(1, 2*n*x_max+1):

            if 0 <= j - y[i-1] <= 2 * n * x_max:

                dp[i][j] = dp[i-1][j-y[i-1]] + dp[i-1][j]

            else:

                dp[i][j] = dp[i-1][j]



    return dp[n][n*x_max] - 1





def main():

    print((ave_comb()))





if __name__ == '__main__':

    main()

n, a = list(map(int, input().split()))
x = list(map(int, input().split()))


def ave_comb(v_max, ave):
    dp = [
        [[0 for c in range(n * v_max + 1)] for b in range(n + 1)] for a 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, i + 1):
            for k in range(1, n * v_max + 1):
                if k - x[i - 1] >= 0:
                    dp[i][j][k] = dp[i - 1][j - 1][k - x[i - 1]] + dp[i - 1][j][k]
                else:
                    dp[i][j][k] = dp[i - 1][j][k]
    ans = 0
    for t in range(1, n + 1):
        ans += dp[n][t][ave * t]
    return ans


def main():
    x_max = max(max(x), a)
    print((ave_comb(x_max, a)))


if __name__ == "__main__":
    main()

n, a = list(map(int, input().split()))
x = list(map(int, input().split()))
x_max = max(x)
y = [i - a for i in x]


def ave_comb():
    dp = [[0 for d in range(2 * n * x_max + 1)] for c in range(n + 1)]
    for i in range(n + 1):
        dp[i][n * x_max] = 1
    for i in range(1, n + 1):
        for j in range(1, 2 * n * x_max + 1):
            if 0 <= j - y[i - 1] <= 2 * n * x_max:
                dp[i][j] = dp[i - 1][j - y[i - 1]] + dp[i - 1][j]
            else:
                dp[i][j] = dp[i - 1][j]
    return dp[n][n * x_max] - 1


def main():
    print((ave_comb()))


if __name__ == "__main__":
    main()

+x_max = max(x) +y = [i - a for i in x] -def ave_comb(v_max, ave): -    dp = [ -        [[0 for c in range(n * v_max + 1)] for b in range(n + 1)] for a in range(n + 1) -    ] +def ave_comb(): +    dp = [[0 for d in range(2 * n * x_max + 1)] for c in range(n + 1)] -        dp[i][0][0] = 1 +        dp[i][n * x_max] = 1 -        for j in range(1, i + 1): -            for k in range(1, n * v_max + 1): -                if k - x[i - 1] >= 0: -                    dp[i][j][k] = dp[i - 1][j - 1][k - x[i - 1]] + dp[i - 1][j][k] -                else: -                    dp[i][j][k] = dp[i - 1][j][k] -    ans = 0 -    for t in range(1, n + 1): -        ans += dp[n][t][ave * t] -    return ans +        for j in range(1, 2 * n * x_max + 1): +            if 0 <= j - y[i - 1] <= 2 * n * x_max: +                dp[i][j] = dp[i - 1][j - y[i - 1]] + dp[i - 1][j] +            else: +                dp[i][j] = dp[i - 1][j] +    return dp[n][n * x_max] - 1 -    x_max = max(max(x), a) -    print((ave_comb(x_max, a))) +    print((ave_comb()))