//let a: [Int] = readLine()!.split(" ").map { Int($0)! }
//print(a)

extension String: CollectionType {} // splitを使うためのおまじない

let na: [Int] = readLine()!.split(" ").map { Int($0)! }
let n = na[0]
let a = na[1]
let xs: [Int] = readLine()!.split(" ").map { Int($0)! }

var v: [Int] = (0...n*50*4).map { _ in 0 }
let gap = n*50*2
v[gap]=1

for x in xs {
    if a-x>0 {
        for(var i = n*a; i >= -n*a; i--){
            v[i+a-x+gap]+=v[i+gap]
        }
    } else {
        for(var i = -n*a; i <= n*a; i++){
            v[i+a-x+gap]+=v[i+gap]
        }
    }
    
}
print(v[gap]-1)