Cats from Two Directions
Gats is hunting mice in a network of tunnels. The network is a tree with vertices. At vertex , there are mice.
Exactly distinct vertices are chosen uniformly at random from all -element subsets of the vertices, and one cat is placed at each chosen vertex.
The mice at a vertex sound an alarm if both of the following conditions hold:
- No cat is placed at .
- After removing and every tunnel incident to , the cats occupy vertices in at least two of the resulting connected components.
If the mice at sound an alarm, all mice at that vertex are counted. Otherwise, none of them are counted.
Find the expected total number of mice that sound the alarm.
Input
The first line contains two integers and (), the number of vertices and the number of cats.
Output
Let the expected total number of mice that sound the alarm be represented as , where and are integers and .
Samples
Sample 1
Input
5 2 10 1 2 3 4 1 2 1 3 1 4 1 5
Output
6
Only the mice at vertex can sound the alarm. Their contribution gives an expected total of mice.
Sample 2
Input
4 2 1 1 1 1 1 2 2 3 3 4
Output
665496236
The expected number of mice sounding the alarm is . Its required representation modulo is .