package main import ( "bufio" "fmt" "os" "sort" "strconv" ) const ( m = 1000000007 ) var ( N int K int A []int ) func f(i, scores, peoples int) int { result := 0 for j := i; j < N; j++ { if (scores+A[j])/(peoples+1) < K { break } result++ result += f(j+1, scores+A[j], peoples+1) result %= m } return result % m } func main() { N = readInt() K = readInt() A = make([]int, N) for i := 0; i < N; i++ { A[i] = readInt() } sort.Sort(sort.Reverse(sort.IntSlice(A))) println(f(0, 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 } func printIntln(v ...int) { if len(v) == 0 { return } b := make([]byte, 0, 4096) for i := 0; i < len(v)-1; i++ { b = append(b, strconv.Itoa(v[i])...) b = append(b, " "...) } b = append(b, strconv.Itoa(v[len(v)-1])...) fmt.Println(string(b)) }