package main

import (
	"fmt"
	"sort"
)

var ans int
func main() {
	var n, a int
	fmt.Scan(&n, &a)
	x := make([]int, n)
	for i := 0; i < n; i++ {
		fmt.Scan(&x[i])
	}
	sort.Ints(x)
	//fmt.Println(x)
	//dp := make([]int, 3000)
	//for i := n-1; i >=0; i-- {
	//	for j := 0; j <= a; j++ {
	//		if j < (dp[i + 1][j] * (i + 1) + x[i]) / i {
	//			dp[i][j] = dp[i + 1][j]
	//		} else {
	//			dp[i][j] = max(dp[i + 1][j], dp[i + 1][j -])
	//		}
	//	}
	//}
	dfs(x, n, a, 0, 0, 0)
	fmt.Println(ans)
}

func dfs(x []int, n, a, sum, m, cnt int) {
	if cnt > 0 {
		if sum/cnt == a && sum%cnt==0{
			//fmt.Println("ヽ(*≧∀≦)ノ :", sum, cnt, sum/cnt, a)
			ans++
			return
		}
	}
	if (n==m) {return};
	dfs(x, n, a, sum+x[m], m+1, cnt+1)
	dfs(x, n, a, sum, m+1, cnt)
	return
}

func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}
