import collections



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

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



for i in range(N):

    X[i] -= A



sums = collections.Counter([0,X[0]])



for i in X[1:]:

    c = collections.Counter()

    for p,q in list(sums.items()):

        c[i+p] = q

    sums += c



print((sums[0]-1))    

from collections import Counter



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

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



for i in range(N):

    X[i] -= A

    

sums = Counter([0,X[0]])



for i in range(1,N):

    ith_x = X[i]

    ith_hash = {}

    for key, value in list(sums.items()):

        ith_hash[ith_x + key] = value

        

    sums += ith_hash

    

print((sums[0]-1))
import collections

N, A = list(map(int, input().split()))
X = list(map(int, input().split()))
for i in range(N):
    X[i] -= A
sums = collections.Counter([0, X[0]])
for i in X[1:]:
    c = collections.Counter()
    for p, q in list(sums.items()):
        c[i + p] = q
    sums += c
print((sums[0] - 1))

from collections import Counter

N, A = list(map(int, input().split()))
X = list(map(int, input().split()))
for i in range(N):
    X[i] -= A
sums = Counter([0, X[0]])
for i in range(1, N):
    ith_x = X[i]
    ith_hash = {}
    for key, value in list(sums.items()):
        ith_hash[ith_x + key] = value
    sums += ith_hash
print((sums[0] - 1))

-import collections +from collections import Counter -sums = collections.Counter([0, X[0]]) -for i in X[1:]: -    c = collections.Counter() -    for p, q in list(sums.items()): -        c[i + p] = q -    sums += c +sums = Counter([0, X[0]]) +for i in range(1, N): +    ith_x = X[i] +    ith_hash = {} +    for key, value in list(sums.items()): +        ith_hash[ith_x + key] = value +    sums += ith_hash