package main

import (
	"fmt"
	"sort"
)

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)
	var ans int
	var dfs func(int, int, int)
	dfs = func(m, sum, cnt int) {
		if cnt > 0 {
			if sum/cnt == a && sum%cnt == 0 {
				ans++
				if m < n {
					dfs(m+1, sum+x[m], cnt+1)
				}
				return

			}
		}
		if n == m {
			return
		}
		dfs(m+1, sum+x[m], cnt+1)
		dfs(m+1, sum, cnt)
		return
	}
	dfs(0, 0, 0)
	fmt.Println(ans)
}
