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

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

from collections import defaultdict

counter = defaultdict(int)
counter[0] = 1

for x in X:
    copy = dict(counter)
    for k,v in copy.items():
        counter[k+x] += v

print(counter[0]-1)
