Colorful Components

아직 제출이 없습니다시간 제한2초메모리 제한512 MB

문제

There are nn nodes, the ii-th of which has color c_ic\_i. For a given integer kk (1kn1 \le k \le n), please count the number of ways to build exactly n1n - 1 undirected edges between the nodes, such that:

  1. The nn nodes form a connected graph. 
  2. If we destroy every edge that connects two nodes of different colors, then every connected component in the remaining graph has at most kk vertices. 

Two ways of building edges are considered different if and only if there exist two nodes ii and jj such that 1i<jn1 \le i < j \le n and there is an edge between them in one of the two ways but not in the other.

Since the number could be large, you only need to output the answer modulo 109+710^9 + 7.

입력

The first line contains two integers, nn and kk (1kn3001 \le k \le n \le 300).

The following nn lines contain integers c_1,c_2,,c_nc\_1, c\_2, \ldots, c\_n denoting the colors of the nodes, one integer per line (1c_in1 \le c\_i \le n).

출력

Output the answer modulo 109+710^9 + 7.