---
{"category_name":"school","problem_code":"KCHESS","problem_name":"Knight Chess","languages_supported":{"0":"C","1":"CPP14","2":"JAVA","3":"PYTH","4":"PYTH 3.6","5":"PYPY","6":"CS2","7":"PAS fpc","8":"PAS gpc","9":"RUBY","10":"PHP","11":"GO","12":"NODEJS","13":"HASK","14":"rust","15":"SCALA","16":"swift","17":"D","18":"PERL","19":"FORT","20":"WSPC","21":"ADA","22":"CAML","23":"ICK","24":"BF","25":"ASM","26":"CLPS","27":"PRLG","28":"ICON","29":"SCM qobi","30":"PIKE","31":"ST","32":"NICE","33":"LUA","34":"BASH","35":"NEM","36":"LISP sbcl","37":"LISP clisp","38":"SCM guile","39":"JS","40":"ERL","41":"TCL","42":"kotlin","43":"PERL6","44":"TEXT","45":"SCM chicken","46":"PYP3","47":"CLOJ","48":"COB","49":"FS"},"max_timelimit":1,"source_sizelimit":50000,"problem_author":"sahil070197","problem_tester":null,"date_added":"12-10-2018","tags":{"0":"sahil070197"},"time":{"view_start_date":1540578600,"submit_start_date":1540578600,"visible_start_date":1540578600,"end_date":1735669800},"is_direct_submittable":false,"layout":"problem"}
---
<span class="solution-visible-txt">All submissions for this problem are available.</span>Abhineet the Chess master of NIT Kurukshetra got bored of 8x8 chess board and invented the new variation of Chess, the one on an infinite chess board. There is only a white king and $N$ black knights. The white king has to avoid checkmate as long as it can.
A situation is given. Determine if white king is in checkmate or not. The white king is in checkmate if and only if it is in check and it is not able to move to any of its neighboring positions which is not in check.
###Input:
- The first line will contain $T$, number of test cases. Then the test cases follow.
- The first line of each test case contains a single integer $N$.
- The next N line contains 2 space-separated integers $Xi$ and $Yi$ denoting the position of knights.
- The next line contains 2 space-separated integers $A$ and $B$ denoting the position of king
###Output:
Print a single line corresponding to each test case β βYESβ (without quotes) β if the king is in checkmate and βNOβ (without quotes) β if the king is not in checkmate.
###Constraints
- $1 \leq T \leq 5$
- $1 \leq N \leq 10^5$
- $-10^9 \leq Xi, Yi, A, B \leq 10^9$
###Sample Input:
2
6
1 0
0 2
2 5
4 4
5 0
6 2
3 2
4
5 6
3 5
2 8
-8 -8
0 0
###Sample Output:
YES
NO
###EXPLANATION:
In the first test case, the king is in cannot move to any valid position
In second test case, the king can easily make a valid move.