n,a=gets.split.map(&:to_i)
array=gets.split.map(&:to_i).sort

smallarray=[]
equalarray=[]
bigarray=[]

array.map{|value|
    if value-a<0
        smallarray.push(a-value)
    elsif value==a
        equalarray.push(0)
    else
        bigarray.push(value-a)
    end
}

bigarray=bigarray.sort
bc=bigarray.count
ec=equalarray.count
sc=smallarray.count

dparray=Array.new(sc).map{Array.new(sc*50+1,0)}

if dparray[0]
    dparray[0][0]=1
    dparray[0][smallarray[0]]=1
end

(sc-1).times{|i|
   
    (sc*50+1).times{|j|
        add=smallarray[i+1]
       dparray[i+1][j]+=dparray[i][j]
       
       if dparray[i+1][j+add]
            dparray[i+1][j+add]+=dparray[i][j]
       end
    }
    
}


dparray2=Array.new(bc).map{Array.new(bc*50+1,0)}

if dparray[0]
    dparray2[0][0]=1
    dparray2[0][bigarray[0]]=1
end

(bc-1).times{|i|
   
    (bc*50+1).times{|j|
        add=bigarray[i+1]
        dparray2[i+1][j]+=dparray2[i][j]
       
       if dparray2[i+1][j+add]
            dparray2[i+1][j+add]+=dparray2[i][j]
       end
    }
    
}


ans=2**ec-1


if dparray[0]&&dparray2[0]
    i=1
    loop{
        if dparray[-1][i] && dparray2[-1][i]
            seki=dparray[-1][i]*dparray2[-1][i]
            seki=seki*(2**ec)
            ans+=seki
        else
            break
        end
        i+=1
    }
    
end

puts ans