n, a = map(int, input().split())
x = list(map(int, input().split()))

MAX = 2501

x = sorted(x)

z = 0
p = []
m = []
for i in range(n):
    x[i] -= a
    if x[i] == 0:
        z += 1
    elif x[i] > 0:
        p.append(x[i])
    else:
        m.append(-1 * x[i])

plus = [0 for _ in range(MAX)]
#minus = [0 for _ in range(MAX)]

ans = 2 ** z - 1

#print(p, m, z)

def calc_plus(temp_sum, i):
    if i >= len(p):
        plus[temp_sum] += 1
        return
    else:
        calc_plus(temp_sum, i + 1)
        calc_plus(temp_sum + p[i], i + 1)

calc_plus(0,0)

#print(plus)

def calc_minus(temp_sum, i):
    if i >= len(m):
        if temp_sum > 0 and plus[temp_sum] > 0:
            global ans
            ans += plus[temp_sum] * (2 ** z)
        return
    else:
        calc_minus(temp_sum, i + 1)
        calc_minus(temp_sum + m[i], i + 1)


calc_minus(0,0)

print(ans)
