You are given an array of integers and an integer . From the array , a new array of size is obtained by concatenating the array , times. For example, if and , then .
In a step, one of the elements is randomly removed from . For example, if then after one step, B could be or or . Let be the expected value of the number of inversions in after steps. An inversion is defined as the number of pairs of indices such that and . Find the value of modulo . It's guaranteed that the answer can be represented as rational fraction where , so print the value .
There are multiple test cases in a single input file.
Input format
Output format
For each test case, print the answer in a new line.
Constraints
-