package main import ( "bufio" "fmt" "os" "sort" "strconv" ) const ( m = 1000000007 ) var ( N int K int A []int ) func f(i, scores int) int { result := 0 for j := i; j < N; j++ { if scores+A[j] < 0 { break } result++ result += f(j+1, scores+A[j]) result %= m } return result } func main() { defer flush() N = readInt() K = readInt() A = make([]int, N) for i := 0; i < N; i++ { A[i] = readInt() - K } sort.Sort(sort.Reverse(sort.IntSlice(A))) println(f(0, 0)) } const ( ioBufferSize = 1 * 1024 * 1024 // 1 MB ) var stdinScanner = func() *bufio.Scanner { result := bufio.NewScanner(os.Stdin) result.Buffer(make([]byte, ioBufferSize), ioBufferSize) result.Split(bufio.ScanWords) return result }() func readString() string { stdinScanner.Scan() return stdinScanner.Text() } func readInt() int { result, err := strconv.Atoi(readString()) if err != nil { panic(err) } return result } var stdoutWriter = bufio.NewWriter(os.Stdout) func flush() { stdoutWriter.Flush() } func println(args ...interface{}) (int, error) { return fmt.Fprintln(stdoutWriter, args...) }