You are given integers N and K, where N is the number of points on the x-axis and K is the number of available colors (1,2..K) of a butterfly.
You want to place these butterflies on the x-axis next to each other such that no butterfly of the same color is sitting adjacent. Also, there is another integer X which means butterflies of color X are allowed to sit adjacent to each other.
Find the number of such possible arrangements mod 109+7
Input format
Note: X can be greater than K.
Output
For every test case print the number of arrangements mod 109+7
Constraints
1≤N≤105
1≤X,K≤5
For test case 1, the possible arrangements include:
(1,1,1)
(1,1,2)
(1,2,1)
(2,1,1)
(2,1,2)