Consider a permutation a_1, a_2, \ldots, a_n (all a_i are distinct integers from to ). We define a -inversion as a sequence of numbers i_1, i_2, \ldots, i_k such that
and
Your task is to determine the number of different -inversions in the given permutation.
The first line contains two integers and (1 \leq n \leq 20000, 2 \leq k \leq 10). The second line contains integers a_1, a_2, \ldots, a_n — the permutation.
Output a single integer: the number of -inversions in the given permutation, modulo 10^9.
1-nji mysal