package main

import "fmt"

func main() {
	var N, A int
	fmt.Scan(&N, &A)
	x := make([]int, N)
	for i := 0; i < N; i++ {
		fmt.Scan(&x[i])
	}
	ans := 0
	for bits := 0; bits < (1 << uint(N)); bits++ {
		tot := 0
		cnt := 0
		for i := 0; i < N; i++ {
			if (bits & (1 << uint(i))) != 0 {
				tot += x[i]
				cnt++
			}
		}
		if cnt > 0 && tot%cnt == 0 && tot/cnt == A {
			ans++
		}
	}
	fmt.Println(ans)
}
