AtCoder Grand Contest 065
翻译中…
Problem Statement
翻译中…
There is a circle on a plane. It has $N$ distinct points on its circumference, numbered $1,2,\dots,N$ in clockwise order.
翻译中…
There are $\frac{N(N-1)}{2}$ line segments that can be drawn by connecting two different points among the $N$ points; you will choose and draw $M$ of these segments. Find the number, modulo $(10^9+7)$, of ways to draw $M$ segments such that no two of them intersect at a point other than their endpoints.
翻译中…
Constraints
翻译中…
$1 \le N \le 10^7$$0 \le M \le \frac{N(N-1)}{2}$
翻译中…
Input
翻译中…
The input is given from Standard Input in the following format:
翻译中…
N M
翻译中…
Output
翻译中…
Print the answer.
翻译中…
样例
Input #1
4 2
Output #1
14
The following examples on the left and in the middle satisfy the conditions. (Note that it is acceptable for the segments to intersect at their endpoints.)
The example on the right is unsuitable because two edges intersect at a point other than their endpoints. All other $\binom{6}{2} - 1 = 14$ ways satisfy the conditions.

Input #2
6 3
Output #2
295
Input #3
2023 1217
Output #3
10811951
Input #4
1234321 2345432
Output #4
789452255
题目信息
题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。