N, A = map(int, input().split())
X = [int(a) for a in input().split()]
PO = [x-A for x in X if x > A]
NE = [A-x for x in X if x < A]
ZE = N - len(PO) - len(NE)

Y = [1] + [0] * (N*50)
Z = [1] + [0] * (N*50)

for i in PO:
    for j in range(len(Y) - A)[::-1]:
        Y[i+j] += Y[j]
for i in NE:
    for j in range(len(Z) - A)[::-1]:
        Z[i+j] += Z[j]

ans = -1
for i in range(len(Y)):
    ans += Y[i] * Z[i] * (2**ZE)
print(ans)