CF1236D Alice and the Doll
题目描述
#### 题目大意
最近,爱丽丝得到了一个新玩偶。它甚至可以走路!
爱丽丝为玩偶建造了一个迷宫,并想对其进行测试。迷宫具有$n$行和$m$列。有$k$个障碍物,第$i$个障碍物位于单元格($x_i,y_i$)上,这意味着第$x_i$个行与第$y_i$列相交的单元格上存在一个禁止通过的障碍物。
然而,玩偶有着缺陷。在**同一**单元格(包括起始单元格)中,它最多只能笔直走或右转**一次**。它无法进入有障碍物的单元格或走出迷宫的界限之外。
现在,爱丽丝正在控制娃娃的动作。她将玩偶放入单元格($1,1$)(即迷宫的左上角)中。最初,玩偶的朝向从$(1,1)$向着$(1,m)$。她想让玩偶**恰好穿过一次所有**单元格而没有障碍,玩偶的行动可以在**任何**地方结束。爱丽丝的想法可以实现吗?
输入格式
第一行包含三个整数$n$,$m$和$k$,它们之间用空格($1≤n,m≤10^5,0≤k≤10^5$)隔开。$n,m$表示迷宫的长宽,$k$表示障碍物的数量。
接下来的$k$行,每行描述一个障碍物,第$i$行包含两个整数$x_i$和$y_i$,($1≤x_i≤n,1≤y_i≤m$)并用空格隔开,这些整数描述了第$i$个障碍物的位置。
数据保证在同一单元格中没有两个障碍物,并且在单元格($1,1$)中没有障碍物。
输出格式
若玩偶可以按照题目中所述的规则精确地经过所有单元格(不包括有障碍的单元格),则打印“Yes”,如果不可能,请打印“No”,当然,答案不需要带引号。
##### 样例解释

从$(1,1)$直走,走到$(1,2)$
从$(1,2)$直走,走到$(1,3)$
从$(1,3)$右转,走到$(2,3)$
从$(2,3)$直走,走到$(3,3)$
从$(3,3)$右转,走到$(3,2)$
从$(3,2)$直走,走到$(3,1)$
说明/提示
Here is the picture of maze described in the first example:
In the first example, the doll can walk in this way:
- The doll is in the cell $ (1, 1) $ , looks to the direction $ 1 $ . Move straight;
- The doll is in the cell $ (1, 2) $ , looks to the direction $ 1 $ . Move straight;
- The doll is in the cell $ (1, 3) $ , looks to the direction $ 1 $ . Turn right;
- The doll is in the cell $ (1, 3) $ , looks to the direction $ 2 $ . Move straight;
- The doll is in the cell $ (2, 3) $ , looks to the direction $ 2 $ . Move straight;
- The doll is in the cell $ (3, 3) $ , looks to the direction $ 2 $ . Turn right;
- The doll is in the cell $ (3, 3) $ , looks to the direction $ 3 $ . Move straight;
- The doll is in the cell $ (3, 2) $ , looks to the direction $ 3 $ . Move straight;
- 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.