import sys



read = sys.stdin.read

readline = sys.stdin.readline

readlines = sys.stdin.readlines

sys.setrecursionlimit(10 ** 9)

INF = 1 << 60

MOD = 1000000007





def main():

    N, A, *X = list(map(int, read().split()))



    M = sum(X)

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

    dp[0][0] = 1



    for i in range(N):

        for j in range(N, 0, -1):

            for k in range(X[i], M + 1):

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



    ans = 0

    for j in range(1, min(N, M // A) + 1):

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



    print(ans)

    return





if __name__ == '__main__':

    main()

import sys



read = sys.stdin.read

readline = sys.stdin.readline

readlines = sys.stdin.readlines

sys.setrecursionlimit(10 ** 9)

INF = 1 << 60

MOD = 1000000007





def main():

    N, A, *X = list(map(int, read().split()))



    X = [x - A for x in X]

    base = 2500

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

    dp[0][base] = 1



    for i in range(N):

        for s in range(5001):

            dp[i + 1][s] = dp[i][s]

            if 0 <= s - X[i] <= 5000:

                dp[i + 1][s] += dp[i][s - X[i]]



    print((dp[N][base] - 1))

    return





if __name__ == '__main__':

    main()

import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10**9)
INF = 1 << 60
MOD = 1000000007


def main():
    N, A, *X = list(map(int, read().split()))
    M = sum(X)
    dp = [[0] * (M + 1) for j in range(N + 1)]
    dp[0][0] = 1
    for i in range(N):
        for j in range(N, 0, -1):
            for k in range(X[i], M + 1):
                dp[j][k] += dp[j - 1][k - X[i]]
    ans = 0
    for j in range(1, min(N, M // A) + 1):
        ans += dp[j][A * j]
    print(ans)
    return


if __name__ == "__main__":
    main()

import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10**9)
INF = 1 << 60
MOD = 1000000007


def main():
    N, A, *X = list(map(int, read().split()))
    X = [x - A for x in X]
    base = 2500
    dp = [[0] * 5001 for _ in range(N + 1)]
    dp[0][base] = 1
    for i in range(N):
        for s in range(5001):
            dp[i + 1][s] = dp[i][s]
            if 0 <= s - X[i] <= 5000:
                dp[i + 1][s] += dp[i][s - X[i]]
    print((dp[N][base] - 1))
    return


if __name__ == "__main__":
    main()

-    M = sum(X) -    dp = [[0] * (M + 1) for j in range(N + 1)] -    dp[0][0] = 1 +    X = [x - A for x in X] +    base = 2500 +    dp = [[0] * 5001 for _ in range(N + 1)] +    dp[0][base] = 1 -        for j in range(N, 0, -1): -            for k in range(X[i], M + 1): -                dp[j][k] += dp[j - 1][k - X[i]] -    ans = 0 -    for j in range(1, min(N, M // A) + 1): -        ans += dp[j][A * j] -    print(ans) +        for s in range(5001): +            dp[i + 1][s] = dp[i][s] +            if 0 <= s - X[i] <= 5000: +                dp[i + 1][s] += dp[i][s - X[i]] +    print((dp[N][base] - 1))