Whiskerwood Junctions
Whiskerwood has clearings connected by trails. The trails form a tree, and the clearings are numbered .
Exactly fish baskets are hidden at distinct clearings. Every set of clearings is chosen with equal probability.
After discovering the baskets, Gats forms the hunting network: the unique smallest connected subgraph of the tree containing every clearing with a basket. When , this network consists of one clearing and no trails.
A clearing is called a junction if it is incident to at least trails within the hunting network. Let be the number of junctions.
Find the expected value of , modulo .
Input
The first line contains two integers and (, ), the number of clearings and fish baskets.
Output
Let the exact expected number of junctions, in lowest terms, be . Let ; the constraints guarantee that .
Samples
Sample 1
Input
1 1
Output
0
The hunting network consists of the only clearing and has no junctions.
Sample 2
Input
4 3 1 2 1 3 1 4
Output
748683265
There are four equally likely basket placements. Only the placement using clearings , , and makes clearing a junction, so the expected value is .