import sys,queue,math,copy,itertools
from fractions import gcd
sys.setrecursionlimit(10**7)
input = sys.stdin.readline
INF = 10**18
MOD = 10**9 + 7
LI = lambda : [int(x) for x in input().split()]
N,A = LI()
_LI = lambda : [int(x)-A for x in input().split()]
X = _LI()

m = [0 for _ in range(50*N)]
Base = 25 * N

for i in range(N):
    m2 = copy.copy(m)
    for j in range(len(m)):
        if m[j]:
            if 0<= j + X[i] < len(m2):
                m2[j+X[i]] += m[j]
    m = m2
    m[X[i] + Base] += 1
print (m[Base])