Forked Yarn
Gats has tied yarn into a tree of knots, numbered from to . Each strand directly connects two knots.
Exactly cats choose distinct knots. Every set of knots is equally likely, and one cat occupies each chosen knot.
Consider a knot . Remove and every strand incident to it. The remaining knots are divided into one or more connected components. Knot is called forked if both of the following conditions hold:
- no cat occupies knot ;
- at least three of the resulting connected components each contain at least one cat.
The number of forked knots depends on the randomly chosen set of occupied knots. Find its expected value modulo .
Input
The first line contains two integers and (, ), the number of knots and the number of cats.
Output
Let be the number of forked knots after the cats choose their knots. Print the expected value modulo .
Formally, if , print the unique integer in the range through congruent to
Samples
Sample 1
Input
4 3 1 2 1 3 1 4
Output
250000002
Only the choice consisting of knots , , and makes knot forked. Therefore, the expected number of forked knots is .
Sample 2
Input
6 4 1 2 1 3 1 4 2 5 2 6
Output
800000006
Across the equally likely choices, knot is forked in choices and knot is forked in choices. Thus, the expected number of forked knots is .