{"trustable":false,"prependHtml":"\u003cstyle type\u003d\u0027text/css\u0027\u003e\n .input, .output {\n border: 1px solid #888888;\n }\n .output {\n margin-bottom: 1em;\n position: relative;\n top: -1px;\n }\n .output pre, .input pre {\n background-color: #EFEFEF;\n line-height: 1.25em;\n margin: 0;\n padding: 0.25em;\n }\n \u003c/style\u003e\n \u003clink rel\u003d\"stylesheet\" href\u003d\"//codeforces.org/s/96598/css/problem-statement.css\" type\u003d\"text/css\" /\u003e\u003cscript\u003e window.katexOptions \u003d { disable: true }; \u003c/script\u003e\n\u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {\n inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027], [\u0027$\u0027,\u0027$\u0027]],\n displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027], [\u0027$$\u0027,\u0027$$\u0027]]\n }\n });\n\u003c/script\u003e\n\u003cscript type\u003d\"text/javascript\" async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS_HTML-full\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003e在 Geraldion 地区,巨型象棋很常见。我们不会深入探讨游戏规则,我们只会说游戏发生在一个 $$$h \\times w$$$ 的棋盘上,它被涂成两种颜色,但与国际象棋不同。几乎所有的格子都是白色的,只有一些是黑色的。目前,Gerald 正在与他的朋友 Pollard 进行一场巨型象棋比赛。Gerald 几乎赢定了,他唯一需要做的就是将兵从棋盘的左上角 (它现在所处的位置) 移动到右下角。Gerald 对胜利如此有信心,以至于他想知道,能以多少种方式取胜?\u003c/p\u003e\n\n\u003cp\u003eGerald 手中的兵只能向两个方向移动:向下或向右。此外,它不能移动到黑色的格子,否则 Gerald 就会失败。在棋盘上没有其他的兵或棋子,所以根据巨型象棋的规则, Gerald 移动他的兵直到游戏结束,而 Pollard 只是观看这个过程。\u003c/p\u003e"}},{"title":"输入","value":{"format":"HTML","content":"\u003cp\u003e输入的第一行包含三个整数:$$$h,w,n$$$,分别表示棋盘的边长,以及黑色格子的数量 $$$(1 \\leq h,w \\leq 10^5,~~1 \\leq n \\leq 2000)$$$。\u003c/p\u003e\n\n\u003cp\u003e接下来的 $$$n$$$ 行包含黑色格子的描述。其中第 $$$i$$$ 行包含数 $$$r_i,c_i$$$ $$$(1 \\leq r_i \\leq h,~~1 \\leq c_i \\leq w)$$$,表示第 $$$i$$$ 个黑色格子的行编号、列编号。\u003c/p\u003e\n\n\u003cp\u003e保证左上角和右下角的格子是白色的,且描述中的所有格子都是不同的。\u003c/p\u003e"}},{"title":"输出","value":{"format":"HTML","content":"\u003cp\u003e输出一个整数:将 Gerald 的兵从左上角移动到右下角的方式数量,对 $$$10^9+7$$$ 取模。\u003c/p\u003e"}},{"title":"示例 1","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e3 4 2\n2 2\n2 3\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e2\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e"}},{"title":"示例 2","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e100 100 3\n15 16\n16 15\n99 88\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e545732279\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e"}}]}