def c_Tak_and_Cards(N, A, S):

    X = max(S + [A])

    y = [0] + [x - A for x in S]

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

    dp[0][N * X] = 1

    for j in range(N + 1):

        for t in range(2 * N * X + 1):

            if j == 0 and t == N * X:

                dp[j][t] = 1

            elif j >= 1 and (t - y[j] < 0 or t - y[j] > 2 * N * X):

                dp[j][t] = dp[j - 1][t]

            elif j >= 1 and 0 <= t - y[j] <= 2 * N * X:

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

            else:

                dp[j][t] = 0

    return dp[N][N * X] - 1

N,A = [int(i) for i in input().split()]

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

print((c_Tak_and_Cards(N, A, S)))
def c_tak_and_cards():

    from collections import defaultdict

    N, A = [int(i) for i in input().split()]

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



    average = [x - A for x in X]

    dp = defaultdict(int)  # dp[s]: y から 1 枚以上選んで整数の和を s にする方法

    dp[0] = 1  # 「選ばない」 1 通り

    for y in average:

        for k, v in list(dp.items()):  # for 文中で要素数が変わってはいけないため

            dp[k + y] += v

    return dp[0] - 1



print((c_tak_and_cards()))
def c_Tak_and_Cards(N, A, S):
    X = max(S + [A])
    y = [0] + [x - A for x in S]
    dp = [[0 for _ in range(2 * N * X + 1)] for _ in range(N + 1)]
    dp[0][N * X] = 1
    for j in range(N + 1):
        for t in range(2 * N * X + 1):
            if j == 0 and t == N * X:
                dp[j][t] = 1
            elif j >= 1 and (t - y[j] < 0 or t - y[j] > 2 * N * X):
                dp[j][t] = dp[j - 1][t]
            elif j >= 1 and 0 <= t - y[j] <= 2 * N * X:
                dp[j][t] = dp[j - 1][t] + dp[j - 1][t - y[j]]
            else:
                dp[j][t] = 0
    return dp[N][N * X] - 1


N, A = [int(i) for i in input().split()]
S = [int(i) for i in input().split()]
print((c_Tak_and_Cards(N, A, S)))

def c_tak_and_cards():
    from collections import defaultdict

    N, A = [int(i) for i in input().split()]
    X = [int(i) for i in input().split()]
    average = [x - A for x in X]
    dp = defaultdict(int)  # dp[s]: y から 1 枚以上選んで整数の和を s にする方法
    dp[0] = 1  # 「選ばない」 1 通り
    for y in average:
        for k, v in list(dp.items()):  # for 文中で要素数が変わってはいけないため
            dp[k + y] += v
    return dp[0] - 1


print((c_tak_and_cards()))

-def c_Tak_and_Cards(N, A, S): -    X = max(S + [A]) -    y = [0] + [x - A for x in S] -    dp = [[0 for _ in range(2 * N * X + 1)] for _ in range(N + 1)] -    dp[0][N * X] = 1 -    for j in range(N + 1): -        for t in range(2 * N * X + 1): -            if j == 0 and t == N * X: -                dp[j][t] = 1 -            elif j >= 1 and (t - y[j] < 0 or t - y[j] > 2 * N * X): -                dp[j][t] = dp[j - 1][t] -            elif j >= 1 and 0 <= t - y[j] <= 2 * N * X: -                dp[j][t] = dp[j - 1][t] + dp[j - 1][t - y[j]] -            else: -                dp[j][t] = 0 -    return dp[N][N * X] - 1 +def c_tak_and_cards(): +    from collections import defaultdict + +    N, A = [int(i) for i in input().split()] +    X = [int(i) for i in input().split()] +    average = [x - A for x in X] +    dp = defaultdict(int)  # dp[s]: y から 1 枚以上選んで整数の和を s にする方法 +    dp[0] = 1  # 「選ばない」 1 通り +    for y in average: +        for k, v in list(dp.items()):  # for 文中で要素数が変わってはいけないため +            dp[k + y] += v +    return dp[0] - 1 -N, A = [int(i) for i in input().split()] -S = [int(i) for i in input().split()] -print((c_Tak_and_Cards(N, A, S))) +print((c_tak_and_cards()))