from collections import defaultdict
inpl = lambda: list(map(int,input().split()))
N, A = inpl()
x = inpl()
y = [ X-A for X in x ]
cur = defaultdict(int)
cur[0] = 1
cur[y[0]] += 1
for i in range(1,N):
    prev = cur
    cur = defaultdict(int)
    for k in prev.keys():
        cur[k] += prev[k]
        cur[k+y[i]] += prev[k]
print(cur[0]-1)