Dr Emmett Brown changed jobs and now teaches computer science at a high school. His class has n students, and he wants to run a programming contest for them. The classroom has only k computers, so the contest has to be a team contest.
Dr Brown believes that a team works well when everyone on it has a similar skill level. He knows the skill level ai of every student. He wants to split the class so that for any two teams there is a number x with the following property. Every student on one of the two teams has skill level at most x, and every student on the other team has skill level at least x. There must be exactly k teams, every team must have at least one student, and there is no upper limit on the size of a team.
Count the ways to form the teams. Teams are not numbered. Two ways are different if some two students are on the same team in one of them and on different teams in the other. Report the count modulo 109+7.