Count how many distinct permutations of 1..N are reachable from the sorted order by exactly M adjacent swaps, modulo 1,000,000,009.
You are given the integer sequence A=[1,2,…,N]A = [1, 2, \ldots, N]A=[1,2,…,N]. You perform exactly MMM swaps, where each swap exchanges the positions of two adjacent numbers.
Write a program that computes the number of distinct sequences that can result, modulo 1 000 000 0091\,000\,000\,0091000000009.
The first line contains two integers NNN and MMM. (2≤N≤20002 \le N \le 20002≤N≤2000, 0≤M≤20000 \le M \le 20000≤M≤2000)
Print, on the first line, the number of sequences that can result, modulo 1 000 000 0091\,000\,000\,0091000000009.