{"trustable":true,"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\u003eAlice got a new doll these days. It can even walk!\u003c/p\u003e\u003cp\u003eAlice has built a maze for the doll and wants to test it. The maze is a grid with $$$n$$$ rows and $$$m$$$ columns. There are $$$k$$$ obstacles, the $$$i$$$-th of them is on the cell $$$(x_i, y_i)$$$, which means the cell in the intersection of the $$$x_i$$$-th row and the $$$y_i$$$-th column.\u003c/p\u003e\u003cp\u003eHowever, the doll is clumsy in some ways. It can only walk straight or turn right at most once in the same cell (including the start cell). It cannot get into a cell with an obstacle or get out of the maze.\u003c/p\u003e\u003cp\u003eMore formally, there exist $$$4$$$ directions, in which the doll can look:\u003c/p\u003e\u003col\u003e \u003cli\u003e The doll looks in the direction along the row from the first cell to the last. While moving looking in this direction the doll will move from the cell $$$(x, y)$$$ into the cell $$$(x, y + 1)$$$; \u003c/li\u003e\u003cli\u003e The doll looks in the direction along the column from the first cell to the last. While moving looking in this direction the doll will move from the cell $$$(x, y)$$$ into the cell $$$(x + 1, y)$$$; \u003c/li\u003e\u003cli\u003e The doll looks in the direction along the row from the last cell to first. While moving looking in this direction the doll will move from the cell $$$(x, y)$$$ into the cell $$$(x, y - 1)$$$; \u003c/li\u003e\u003cli\u003e The doll looks in the direction along the column from the last cell to the first. While moving looking in this direction the doll will move from the cell $$$(x, y)$$$ into the cell $$$(x - 1, y)$$$. \u003c/li\u003e\u003c/ol\u003e.\u003cp\u003eStanding in some cell the doll can move into the cell in the direction it looks or it can turn right once. Turning right once, the doll switches it\u0027s direction by the following rules: $$$1 \\to 2$$$, $$$2 \\to 3$$$, $$$3 \\to 4$$$, $$$4 \\to 1$$$. Standing in one cell, the doll can make at most one turn right.\u003c/p\u003e\u003cp\u003eNow Alice is controlling the doll\u0027s moves. She puts the doll in of the cell $$$(1, 1)$$$ (the upper-left cell of the maze). Initially, the doll looks to the direction $$$1$$$, so along the row from the first cell to the last. She wants to let the doll walk across all the cells without obstacles exactly once and end in any place. Can it be achieved?\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eThe first line contains three integers $$$n$$$, $$$m$$$ and $$$k$$$, separated by spaces ($$$1 \\leq n,m \\leq 10^5, 0 \\leq k \\leq 10^5$$$)\u0026nbsp;— the size of the maze and the number of obstacles.\u003c/p\u003e\u003cp\u003eNext $$$k$$$ lines describes the obstacles, the $$$i$$$-th line contains two integer numbers $$$x_i$$$ and $$$y_i$$$, separated by spaces ($$$1 \\leq x_i \\leq n,1 \\leq y_i \\leq m$$$), which describes the position of the $$$i$$$-th obstacle.\u003c/p\u003e\u003cp\u003eIt is guaranteed that no two obstacles are in the same cell and no obstacle is in cell $$$(1, 1)$$$.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003ePrint \u0027Yes\u0027 (without quotes) if the doll can walk across all the cells without obstacles exactly once by the rules, described in the statement.\u003c/p\u003e\u003cp\u003eIf it is impossible to walk across the maze by these rules print \u0027No\u0027 (without quotes).\u003c/p\u003e"}},{"title":"Examples","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 3 2\n2 2\n2 1\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eYes\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"","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 3 2\n3 1\n2 2\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eNo\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"","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 3 8\n1 2\n1 3\n2 1\n2 2\n2 3\n3 1\n3 2\n3 3\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eYes\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Note","value":{"format":"HTML","content":"\u003cp\u003eHere is the picture of maze described in the first example:\u003c/p\u003e\u003ccenter\u003e \u003cimg class\u003d\"tex-graphics\" src\u003d\"CDN_BASE_URL/c86995ee5793c6147e531a9989506347?v\u003d1715373514\" style\u003d\"max-width: 100.0%;max-height: 100.0%;\"\u003e \u003c/center\u003e\u003cp\u003eIn the first example, the doll can walk in this way:\u003c/p\u003e\u003cul\u003e \u003cli\u003e The doll is in the cell $$$(1, 1)$$$, looks to the direction $$$1$$$. Move straight; \u003c/li\u003e\u003cli\u003e The doll is in the cell $$$(1, 2)$$$, looks to the direction $$$1$$$. Move straight; \u003c/li\u003e\u003cli\u003e The doll is in the cell $$$(1, 3)$$$, looks to the direction $$$1$$$. Turn right; \u003c/li\u003e\u003cli\u003e The doll is in the cell $$$(1, 3)$$$, looks to the direction $$$2$$$. Move straight; \u003c/li\u003e\u003cli\u003e The doll is in the cell $$$(2, 3)$$$, looks to the direction $$$2$$$. Move straight; \u003c/li\u003e\u003cli\u003e The doll is in the cell $$$(3, 3)$$$, looks to the direction $$$2$$$. Turn right; \u003c/li\u003e\u003cli\u003e The doll is in the cell $$$(3, 3)$$$, looks to the direction $$$3$$$. Move straight; \u003c/li\u003e\u003cli\u003e The doll is in the cell $$$(3, 2)$$$, looks to the direction $$$3$$$. Move straight; \u003c/li\u003e\u003cli\u003e The doll is in the cell $$$(3, 1)$$$, looks to the direction $$$3$$$. The goal is achieved, all cells of the maze without obstacles passed exactly once. \u003c/li\u003e\u003c/ul\u003e"}}]}