#復習用

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

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

maxn = max(max(X), A)

 

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

dp[0][N * maxn] = 1

for i in range(N):

    for k in range(2 * N * maxn + 1):

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

        if 0 <= k - X[i] < 2 * N * maxn:

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

print((dp[N][N * maxn] - 1))
#!/usr/bin/env python3

#ABC44 C



import sys

import math

import bisect

from heapq import heappush, heappop

from collections import defaultdict

from itertools import accumulate

from collections import Counter

from collections import deque

from operator import itemgetter

mod = 10**9 + 7



n,a = list(map(int, input().split()))

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

Y = list([x-a for x in X])

d = defaultdict(int)

d[0] = 1

for y in Y:

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

        d[k+y] += v

print((d[0]-1))



# 復習用
N, A = list(map(int, input().split()))
X = list([int(x) - A for x in input().split()])
maxn = max(max(X), A)
dp = [[0 for _ in range(2 * N * maxn + 1)] for _ in range(N + 1)]
dp[0][N * maxn] = 1
for i in range(N):
    for k in range(2 * N * maxn + 1):
        dp[i + 1][k] = dp[i][k]
        if 0 <= k - X[i] < 2 * N * maxn:
            dp[i + 1][k] += dp[i][k - X[i]]
print((dp[N][N * maxn] - 1))

#!/usr/bin/env python3
# ABC44 C
import sys
import math
import bisect
from heapq import heappush, heappop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter

mod = 10**9 + 7
n, a = list(map(int, input().split()))
X = list(map(int, input().split()))
Y = list([x - a for x in X])
d = defaultdict(int)
d[0] = 1
for y in Y:
    for k, v in list(d.items()):
        d[k + y] += v
print((d[0] - 1))

-# 復習用 -N, A = list(map(int, input().split())) -X = list([int(x) - A for x in input().split()]) -maxn = max(max(X), A) -dp = [[0 for _ in range(2 * N * maxn + 1)] for _ in range(N + 1)] -dp[0][N * maxn] = 1 -for i in range(N): -    for k in range(2 * N * maxn + 1): -        dp[i + 1][k] = dp[i][k] -        if 0 <= k - X[i] < 2 * N * maxn: -            dp[i + 1][k] += dp[i][k - X[i]] -print((dp[N][N * maxn] - 1)) +#!/usr/bin/env python3 +# ABC44 C +import sys +import math +import bisect +from heapq import heappush, heappop +from collections import defaultdict +from itertools import accumulate +from collections import Counter +from collections import deque +from operator import itemgetter + +mod = 10**9 + 7 +n, a = list(map(int, input().split())) +X = list(map(int, input().split())) +Y = list([x - a for x in X]) +d = defaultdict(int) +d[0] = 1 +for y in Y: +    for k, v in list(d.items()): +        d[k + y] += v +print((d[0] - 1))