from copy import deepcopy

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

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

cnt = [0] * 5000

for x in X:
    cnt2 = [0] * 5000
    for i in range(-2500, 2500):
        cnt2[i + x] += cnt[i]
    cnt2[x] += 1
    for i in range(5000):
        cnt2[i] += cnt[i]
    cnt = deepcopy(cnt2)

print(cnt[0])
