Rainbow Leap Parade
Gats is organizing a parade of cats. There are cats, indexed from to . Cat has jump strength , fur color , and fish reward . Cats with equal color values have the same fur color.
Gats forms a parade by choosing exactly distinct cats and placing them in an ordered list . Every ordered list of distinct cats is equally likely.
For every position satisfying , consider the consecutive trio . The middle cat performs a if both of the following conditions hold:
- The three colors , , and are pairwise distinct.
Whenever a rainbow leap occurs at position , the parade earns fish. Contributions from different positions are counted independently, even when their trios overlap.
Find the expected total number of fish earned by the parade.
Input
The first line contains two integers and (), the number of cats and the parade length.
Output
Let . Print the expected total number of fish earned, modulo .
For a rational number with , its value modulo is defined as .
Samples
Sample 1
Input
3 3 1 1 5 2 2 7 3 3 11
Output
333333338
All three colors are different. Of the possible parades, exactly have the cat of strength in the middle. Each of those parades scores fish, so the expectation is , whose value modulo is .