import sys

import itertools

# import numpy as np

import time

import math

import heapq

from collections import defaultdict

sys.setrecursionlimit(10 ** 7)

 

INF = 10 ** 18

MOD = 10 ** 9 + 7

read = sys.stdin.buffer.read

readline = sys.stdin.buffer.readline

readlines = sys.stdin.buffer.readlines



# map(int, input().split())



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

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



dp = [[0] * 2501 for _ in range(51)]



dp[0][0] = 1

for i in range(N):

    x = X[i]

    for j in range(i, -1, -1):

        for k in range(2501):

            if k < x:

                continue

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

ans = 0

for i in range(1, 51):

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

print(ans)



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

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

Y = [x - A for x in X]



dp = [0] * 5010

dp[2500] = 1



for y in Y:

    r = []

    if y >= 0:

        r = list(range(5009, -1, -1))

    else:

        r = list(range(5010))

    for i in r:

        if i - y < 0 or i - y >= 5010:

            continue

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

print((dp[2500] - 1))

import sys
import itertools

# import numpy as np
import time
import math
import heapq
from collections import defaultdict

sys.setrecursionlimit(10**7)
INF = 10**18
MOD = 10**9 + 7
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
# map(int, input().split())
N, A = list(map(int, input().split()))
X = list(map(int, input().split()))
dp = [[0] * 2501 for _ in range(51)]
dp[0][0] = 1
for i in range(N):
    x = X[i]
    for j in range(i, -1, -1):
        for k in range(2501):
            if k < x:
                continue
            dp[j + 1][k] += dp[j][k - x]
ans = 0
for i in range(1, 51):
    ans += dp[i][i * A]
print(ans)

N, A = list(map(int, input().split()))
X = list(map(int, input().split()))
Y = [x - A for x in X]
dp = [0] * 5010
dp[2500] = 1
for y in Y:
    r = []
    if y >= 0:
        r = list(range(5009, -1, -1))
    else:
        r = list(range(5010))
    for i in r:
        if i - y < 0 or i - y >= 5010:
            continue
        dp[i] += dp[i - y]
print((dp[2500] - 1))

-import sys -import itertools - -# import numpy as np -import time -import math -import heapq -from collections import defaultdict - -sys.setrecursionlimit(10**7) -INF = 10**18 -MOD = 10**9 + 7 -read = sys.stdin.buffer.read -readline = sys.stdin.buffer.readline -readlines = sys.stdin.buffer.readlines -# map(int, input().split()) -dp = [[0] * 2501 for _ in range(51)] -dp[0][0] = 1 -for i in range(N): -    x = X[i] -    for j in range(i, -1, -1): -        for k in range(2501): -            if k < x: -                continue -            dp[j + 1][k] += dp[j][k - x] -ans = 0 -for i in range(1, 51): -    ans += dp[i][i * A] -print(ans) +Y = [x - A for x in X] +dp = [0] * 5010 +dp[2500] = 1 +for y in Y: +    r = [] +    if y >= 0: +        r = list(range(5009, -1, -1)) +    else: +        r = list(range(5010)) +    for i in r: +        if i - y < 0 or i - y >= 5010: +            continue +        dp[i] += dp[i - y] +print((dp[2500] - 1))