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

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



for i in range(N):

    X[i] -= A



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

dp[0][50*N] = 1



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

    for summ in range(2*50*N+1):

        if 0 <= summ-X[i-1] <= 100*N:

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

        else:

            dp[i][summ] = dp[i-1][summ]

            

print((dp[N][50*N]-1))
from collections import Counter



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

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



X = [X[i] - A for i in range(N)]



sums = Counter([0, X[0]])



for x in X[1:]:

    c = Counter()

    for k,v in list(sums.items()):

        c[x+k] = v

    sums += c

    

print((sums[0]-1))
N, A = list(map(int, input().split()))
X = list(map(int, input().split()))
for i in range(N):
    X[i] -= A
dp = [[0 for _ in range(100 * N + 1)] for _ in range(N + 1)]
dp[0][50 * N] = 1
for i in range(1, N + 1):
    for summ in range(2 * 50 * N + 1):
        if 0 <= summ - X[i - 1] <= 100 * N:
            dp[i][summ] = dp[i - 1][summ] + dp[i - 1][summ - X[i - 1]]
        else:
            dp[i][summ] = dp[i - 1][summ]
print((dp[N][50 * N] - 1))

from collections import Counter

N, A = list(map(int, input().split()))
X = list(map(int, input().split()))
X = [X[i] - A for i in range(N)]
sums = Counter([0, X[0]])
for x in X[1:]:
    c = Counter()
    for k, v in list(sums.items()):
        c[x + k] = v
    sums += c
print((sums[0] - 1))

+from collections import Counter + -for i in range(N): -    X[i] -= A -dp = [[0 for _ in range(100 * N + 1)] for _ in range(N + 1)] -dp[0][50 * N] = 1 -for i in range(1, N + 1): -    for summ in range(2 * 50 * N + 1): -        if 0 <= summ - X[i - 1] <= 100 * N: -            dp[i][summ] = dp[i - 1][summ] + dp[i - 1][summ - X[i - 1]] -        else: -            dp[i][summ] = dp[i - 1][summ] -print((dp[N][50 * N] - 1)) +X = [X[i] - A for i in range(N)] +sums = Counter([0, X[0]]) +for x in X[1:]: +    c = Counter() +    for k, v in list(sums.items()): +        c[x + k] = v +    sums += c +print((sums[0] - 1))