---
{"category_name":"easy","problem_code":"THREEPTS","problem_name":"Three Points","problemComponents":{"constraints":"- $1 \\leq T \\leq 2 \\cdot 10^5$\n- $-10^9 \\leq X_A, Y_A, X_B, Y_B, X_C, Y_C \\leq 10^9$\n- Three points are pairwise distinct","constraintsState":true,"subtasks":"- 30 points : $1 \\leq R \\leq 10000$\n- 70 points : $1 \\leq R \\leq 10^9$\n","subtasksState":false,"inputFormat":"- The first line of input contains a single integer $T$ denoting the number of test cases. The description of $T$ test cases follows.\n- The first line of each test case contains two space-separated integers $X_A, Y_A$, denoting the coordinates of the starting point $A$.\n- The second line of each test case contains two space-separated integers $X_B, Y_B$, denoting the coordinates of the point $B$.\n- The third line of each test case contains two space-separated integers $X_C, Y_C$, denoting the coordinates of the finishing point $C$.\n","inputFormatState":true,"outputFormat":"For each test case, print a single line containing one string - `\u0022YES\u0022`(without quotes) if it is possible to reach the finishing point satisfying the above conditions, otherwise print `\u0022NO\u0022`(without quotes).","outputFormatState":true,"sampleTestCases":{"0":{"id":1,"input":"4\n1 1\n1 3\n3 3\n0 0\n2 2\n3 4\n5 2\n3 2\n1 2\n1 1\n-1 1\n10000 10000\n","output":"YES\nNO\nYES\nNO","explanation":"- **Test case $1$:** You start moving in the $+Y$ direction from $A = (1, 1)$, after two-unit steps you reach the point $B = (1, 3)$. Then you make a clockwise turn at point $B$ and start moving towards the $+X$ direction. After two-unit steps, you reach the finishing point $C = (3, 3)$.\n\n- **Test case $2$:** There is no possible way to reach the finishing point $C$ satisfying the above conditions. You have to make at least two turns in the path.\n\n- **Test case $3$:** You start moving in the $-X$ direction from $A = (5, 2)$ . After 4 unit steps, you reach the finish point $C = (1, 2)$. In the path from $A$ to $C$, you go through the point $B = (3,2)$ and don\u0027t make any turn.","isDeleted":false}}},"video_editorial_url":"https://youtu.be/MXW1HQHXEOM","languages_supported":{"0":"CPP14","1":"C","2":"JAVA","3":"PYTH 3.6","4":"CPP17","5":"PYTH","6":"PYP3","7":"CS2","8":"ADA","9":"PYPY","10":"TEXT","11":"PAS fpc","12":"NODEJS","13":"RUBY","14":"PHP","15":"GO","16":"HASK","17":"TCL","18":"PERL","19":"SCALA","20":"LUA","21":"kotlin","22":"BASH","23":"JS","24":"LISP sbcl","25":"rust","26":"PAS gpc","27":"BF","28":"CLOJ","29":"R","30":"D","31":"CAML","32":"FORT","33":"ASM","34":"swift","35":"FS","36":"WSPC","37":"LISP clisp","38":"SQL","39":"SCM guile","40":"PERL6","41":"ERL","42":"CLPS","43":"ICK","44":"NICE","45":"PRLG","46":"ICON","47":"COB","48":"SCM chicken","49":"PIKE","50":"SCM qobi","51":"ST","52":"SQLQ","53":"NEM"},"max_timelimit":1,"source_sizelimit":50000,"problem_author":"soumyadeep_21","problem_tester":"","date_added":"20-07-2021","tags":{"0":"observation","1":"observation","2":"simple","3":"simple","4":"soumyadeep_21","5":"start8","6":"start8"},"problem_difficulty_level":"Unavailable","best_tag":"","editorial_url":"https://discuss.codechef.com/problems/THREEPTS","time":{"view_start_date":1629124200,"submit_start_date":1629124200,"visible_start_date":1629124200,"end_date":1735669800},"is_direct_submittable":false,"problemDiscussURL":"https://discuss.codechef.com/search?q=THREEPTS","is_proctored":false,"visitedContests":{},"layout":"problem"}
---
### Read problem statements in [Russian](https://www.codechef.com/download/translated/START8/russian/THREEPTS.pdf), [Mandarin Chinese](https://www.codechef.com/download/translated/START8/mandarin/THREEPTS.pdf), [Bengali](https://www.codechef.com/download/translated/START8/bengali/THREEPTS.pdf), and [Vietnamese](https://www.codechef.com/download/translated/START8/vietnamese/THREEPTS.pdf) as well.
There are three **distinct** points - $A, B, C$ in the $X-Y$ plane. Initially, you are located at point $A$. You want to reach the point $C$ satisfying the following conditions:
- You have to go through point B.
- You can move in any of the four axis-parallel directions ($+X$, $-X$, $+Y$, $-Y$ direction). However, you can make **at most** one turn in the path from $A$ to $C$.
Determine if it is possible to reach the destination $C$ satisfying the above conditions.
**NOTE**:
- One turn means $90 ^ \circ$ clockwise or anticlockwise rotation along the direction of movement. For example, if you are moving towards the $+X$ direction, after one turn you can move either in the $+Y$ direction or in the $-Y$ direction. **Changing the direction by $180 ^ \circ$ is not allowed**.
<aside style='background: #f8f8f8;padding: 10px 15px;'><div>All submissions for this problem are available.</div></aside>