# ABC044C - 高橋君とカード / Tak and Cards (ARC060C)

def main():

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

    X = tuple(map(int, input().split()))

    # dp[i][j][k] := patterns to make k with j cards from X1, X2, ..., Xi

    dp = [[[0] * (N * 50 + 1) for _ in range(N + 1)] for _ in range(N + 1)]

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

    for i in range(N):

        for j in range(N):

            for k in range(N * 50 + 1):

                if dp[i][j][k]:

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

                    dp[i + 1][j + 1][k + X[i]] += dp[i][j][k]

    ans = sum(dp[N][i][i * A] for i in range(1, N + 1))

    print(ans)





if __name__ == "__main__":

    main()
# ABC044C - 高橋君とカード / Tak and Cards (ARC060C)

def main():

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

    X = tuple([int(x) - A for x in input().split()])

    D = {0: 1}

    for i in X:

        for j, k in list(D.items()):

            D[i + j] = D.get(i + j, 0) + k

    ans = D[0] - 1

    print(ans)





if __name__ == "__main__":

    main()
# ABC044C - 高橋君とカード / Tak and Cards (ARC060C)
def main():
    N, A = tuple(map(int, input().split()))
    X = tuple(map(int, input().split()))
    # dp[i][j][k] := patterns to make k with j cards from X1, X2, ..., Xi
    dp = [[[0] * (N * 50 + 1) for _ in range(N + 1)] for _ in range(N + 1)]
    dp[0][0][0] = 1
    for i in range(N):
        for j in range(N):
            for k in range(N * 50 + 1):
                if dp[i][j][k]:
                    dp[i + 1][j][k] += dp[i][j][k]
                    dp[i + 1][j + 1][k + X[i]] += dp[i][j][k]
    ans = sum(dp[N][i][i * A] for i in range(1, N + 1))
    print(ans)


if __name__ == "__main__":
    main()

# ABC044C - 高橋君とカード / Tak and Cards (ARC060C)
def main():
    N, A = tuple(map(int, input().split()))
    X = tuple([int(x) - A for x in input().split()])
    D = {0: 1}
    for i in X:
        for j, k in list(D.items()):
            D[i + j] = D.get(i + j, 0) + k
    ans = D[0] - 1
    print(ans)


if __name__ == "__main__":
    main()

-    X = tuple(map(int, input().split())) -    # dp[i][j][k] := patterns to make k with j cards from X1, X2, ..., Xi -    dp = [[[0] * (N * 50 + 1) for _ in range(N + 1)] for _ in range(N + 1)] -    dp[0][0][0] = 1 -    for i in range(N): -        for j in range(N): -            for k in range(N * 50 + 1): -                if dp[i][j][k]: -                    dp[i + 1][j][k] += dp[i][j][k] -                    dp[i + 1][j + 1][k + X[i]] += dp[i][j][k] -    ans = sum(dp[N][i][i * A] for i in range(1, N + 1)) +    X = tuple([int(x) - A for x in input().split()]) +    D = {0: 1} +    for i in X: +        for j, k in list(D.items()): +            D[i + j] = D.get(i + j, 0) + k +    ans = D[0] - 1