import sequtils, strutils,algorithm,math

proc p2(i : int):int64 =
    return 1.int64 shl i

var N,A : int
(N, A) = stdin.readline.split.map(parseInt)
var X = stdin.readline.split.map(parseInt)

for i,x in X:
    X[i] = x - A

X.sort(system.cmp)

var
    zeroid = -1
    plasid = -1
    Xminas : seq[int]

for i,x in X:
    if x >= 0 and zeroid == -1:
        zeroid = i
    if x > 0 and plasid == -1:
        plasid = i
        break
if zeroid == -1:
    echo 0
elif plasid == 0:
    echo 0
if plasid == -1:
    echo p2(N - zeroid)
else:
    Xminas = X[0..<zeroid]
    X = X[plasid..X.high]
    var X_sum = newSeqWith(X.len + 1,newSeq[int](sum(X) + 1))
    X_sum[0][0] = 1
    for i,x in X:
        for j in 0..<x:
            X_sum[i + 1][j] = X_sum[i][j]
        for j in x..sum(X):
            X_sum[i + 1][j] = X_sum[i][j - x] + X_sum[i][j]
    var Xm_sum = newSeqWith(Xminas.len + 1,newSeq[int](-sum(Xminas) + 1))
    Xm_sum[0][0] = 1
    for i,x in Xminas:
        for j in 0..<(-x):
            Xm_sum[i + 1][j] = Xm_sum[i][j]
        for j in (-x)..(-sum(Xminas)):
            Xm_sum[i + 1][j] = Xm_sum[i][j] + Xm_sum[i][j + x]
    
    var cnt : int64
    for i in 0..min(sum(X),-sum(Xminas)):
        cnt += (Xm_sum[^1][i] * X_sum[^1][i]).int64
    echo p2(plasid - zeroid) * cnt - 1
    
    


