Knights
Very hard
Execution time limit is 2 seconds
Runtime memory usage limit is 256 megabytes
There are n pairs of knights who are enemies. Additionally, there is a round table with m seats, where m is at least 2n. The seats are numbered from 1 to m in a circular arrangement.
Your task is to determine how many ways the knights can be seated in 2n of these seats such that no pair of enemy knights is sitting next to each other.
Input
The input consists of two integers n and m (1 ≤ n ≤ 10^5, 2n ≤ m ≤ 3·10^5).
Output
Output the number of valid seating arrangements, modulo 1000000007 (10^9+7).
Examples
Input #1
Answer #1
Submissions 33