Problem #212
Functional Permutations
Given a permutation p of length n, we define the following functions
S(p) = { i : p(i) > p(i+1), 1 \le i \le n-1 }
f(p) = Sum of elements of S(p).
Let F(n,k) = number of permutations p of length n with f(p) = k.
find F(123,321) modulo 10^9 +7