def main():
    t = input().split(" ")
    N, A= int(t[0]), int(t[1])

    t = input().split(" ")
    x_p = []
    x_n = []
    x_z = 0
    for i in t:
        i = int(i)
        if A < i:
            x_p.append(i - A)
        elif i < A:
            x_n.append(A - i)
        else:
            x_z += 1
    x_p.sort()
    x_n.sort()
    x_p_sum=[{0:1}]
    x_n_sum=[{0:1}]
    for i in range(len(x_p)):
        x_p_sum.append({})
        for j in x_p_sum[i]:
            if j in x_p_sum[i+1]:
                x_p_sum[i+1][j] += x_p_sum[i][j]
            else:
                x_p_sum[i+1][j] = x_p_sum[i][j]
            x_p_sum[i+1][j+x_p[i]] = x_p_sum[i][j]
    for i in range(len(x_n)):
        x_n_sum.append({})
        for j in x_n_sum[i]:
            if j in x_n_sum[i+1]:
                x_n_sum[i+1][j] += x_n_sum[i][j]
            else:
                x_n_sum[i+1][j] = x_n_sum[i][j]
            x_n_sum[i+1][j+x_n[i]] = x_n_sum[i][j]
    sum = 0
    for i in x_n_sum[-1]:
        if i in x_p_sum[-1]:
            sum += (x_n_sum[-1][i] * x_p_sum[-1][i])
    sum *= 2**x_z
    sum -= 1
    print(sum)
main()
