CF1033A King Escape

题目描述

艾丽丝和鲍勃正在一个n*n大棋盘上下棋。爱丽丝只剩下一个皇后,位于(a_x,a_y),而鲍勃只有一个国王,位于(b_x,b_y)。爱丽丝认为,她的皇后是主宰棋盘的,所以胜利是属于她的。但是鲍勃已经制定了一个计划来赢得胜利,他需要移动国王到(c_x,c_y),以便为自己争取胜利。当爱丽丝被她的自信所分心时,她将不会移动他的皇后,只有鲍勃才能进行移动。如果鲍勃能把他的国王从(b_x,b_y)移到(c_x,c_y),他就会赢。请记住,国王可以移动到任何8个相邻的棋格。如果国王与皇后处于同一行、同一列或同一对角线,则将所到攻击。看看鲍勃能不能赢。

输入格式

第一行:一个数:棋盘的行数和列数n(3

输出格式

能赢输出"YES",否则输出"NO" ### (样例解析请看图)

说明/提示

In the diagrams below, the squares controlled by the black queen are marked red, and the target square is marked blue. In the first case, the king can move, for instance, via the squares $ (2, 3) $ and $ (3, 2) $ . Note that the direct route through $ (2, 2) $ goes through check. ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF1033A/e1724c6b8b5ec4aee00605b5e9263ab174895bb4.png)In the second case, the queen watches the fourth rank, and the king has no means of crossing it. ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF1033A/d88d0afaadef02666e6f739ed600c7a8a7b4edf3.png)In the third case, the queen watches the third file. ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF1033A/4f0a8304f3080f75771392809c070e9887a234f5.png)