{"problem":{"name":"Not Intersect","description":{"content":"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","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":3000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"agc065_d"},"statements":[{"statement_type":"Markdown","content":"There is a circle on a plane. It has $N$ distinct points on its circumference, numbered $1,2,\\dots,N$ in clockwise order.\nThere 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.\n\n## Constraints\n\n*   $1 \\le N \\le 10^7$\n*   $0 \\le M \\le \\frac{N(N-1)}{2}$\n\n## Input\n\nThe input is given from Standard Input in the following format:\n\n$N$ $M$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"agc065_d","tags":[],"sample_group":[["4 2","14\n\nThe 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.)\nThe 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.\n![image](https://img.atcoder.jp/agc065/4854b47261fd9c54c2d25ee53c3e6be5.png)"],["6 3","295"],["2023 1217","10811951"],["1234321 2345432","789452255"]],"created_at":"2026-03-03 11:01:14"}}