Cat Councils at the Crossroads
A group of cats visits a tree with vertices. A set of exactly distinct vertices is chosen uniformly at random from all possible sets, and one cat is placed at each chosen vertex.
Consider a vertex . Temporarily remove and every edge incident to it. Each resulting connected component represents one direction from . A direction is called active if its component contains at least one cat.
A cat placed directly at does not make any direction active. A council forms at if at least of its directions are active.
Let be the total number of vertices at which a council forms. Find the expected value of , modulo .
Input
The first line contains two integers and (, ), the number of vertices and the number of chosen vertices.
Output
Let be the expected number of vertices at which a council forms. Write , where and are integers and .
Samples
Sample 1
Input
4 3 1 2 1 3 1 4
Output
250000002
There are equally likely chosen sets. A council forms only when the chosen set is , so the expectation is . Its required modular representation is .