N,A=gets.split.map(&:to_i)
x=gets.split.map(&:to_i)
N2=50

dp = Array.new(N2+1).map{Array.new(N2+1).map{Array.new(N2*50,0)}}
dp[0][0][0]=1
(0...N).each{|i|
    (0..i).each{|j|
        (0..i*50).each{|k|
            dp[i+1][j][k] += dp[i][j][k]
            dp[i+1][j+1][k+x[i]] += dp[i][j][k]
        }
    }
}

total = 0
(1..N).each{|j|
    total += dp[N][j][j*A]
}

puts total
