You are in the future. It's the time of autonomous cars. Switching lanes is a pretty difficult task for autonomous cars, and you have the logs from an experiment you had run with two cars. You want to verify whether the logs are corrupted, or could be valid.
In that experiment, you had a highway consisting of two lanes. These were represented by 2 rows of an infinite grid. The cell (1, 1) is the top left cell which is the starting point of the first lane. Cell (2, 1) is the bottom left cell of the grid which is the starting point of the second lane.
There are two cars, 1 and 2 that start from the cell (1, 1) and (2, 1). 
At each instant, a car has the following choices.
- Stay at the current position.
- Move one cell to the right.
- Switch Lanes. When a car switches its lane, it stays in the same column. That is, from (1, i) it could go to (2, i), or from (2, i) it could go to (1, i). But both both cars shouldn't end up at the same cell at any point. Note that there could have been a car which had moved at the very instant that you move into it.
Consider one such scenario of driving cars.
Time $t = 0$
1.....
2.....

Time $t = 1$. Car 2 advances one cell right. Car 1 stays at the same place.
1.....
.2....

Time $t = 2$. Car 2 stays at its place. Car 1 switches the lane.
......
12....

Time $t = 3$. Car 2 moves one cell to the right.  Car 1 also moves one cell to the right.
......
.12...

Time $t = 4$. Both the cars stay in the same place.
......
.12...

You are given positions of the car at $n$ instants. Your task is to check whether this situation is feasible or not.

-----Input-----
- The first line of the input contains an integer $T$ denoting the number of test cases. The description of the test cases follows.
- The first line of each test case contains an integer $n$ denoting the number of instants where the positions of the cars were recorded.
- Each of next $n$ lines contains 5 space separated integers denoting $t_i, x_i, y_i, X_i, Y_i$ denoting time, $x$ and $y$ coordinate of the first car, and that of second car.

-----Output-----
For each test case, output either yes or no according to the answer to the problem.

-----Constraints-----
- $1 \le T \le 10^5$
- $1 \le n \leq 10^5$
- $1 \le t_i, y_i, X_i, Y_i \leq 10^9$
- $1 \leq x_i \leq 2$
- $t_i < t_{i+1}$
- Sum of $n$ over all the test cases doesn't exceed $10^6$

-----Example Input-----
2
3
1 1 1 2 2
2 2 1 2 2
4 2 2 2 3
1
1 1 3 2 2

-----Example Output-----
yes
no

```python

USER_FILENAME = "<user_code>"
import sys, json, builtins
import math, heapq, bisect, itertools, functools, collections, statistics, fractions, decimal, operator, array, random, re, string, os, pathlib
try:
    import resource as _res
except Exception:
    _res = None
from collections import Counter, defaultdict, deque, OrderedDict
from functools import lru_cache, reduce
from itertools import accumulate, permutations, combinations, product
from math import gcd, ceil, floor, sqrt
from decimal import Decimal
try:
    from typing import *
except Exception:
    pass
try:
    sys.setrecursionlimit(1_000_000)
except Exception:
    pass
try:
    import site as _site
    try:
        _sys_sites = _site.getsitepackages() if hasattr(_site, "getsitepackages") else []
        for _p in _sys_sites:
            if _p and _p not in sys.path:
                sys.path.append(_p)
    except Exception:
        pass
    try:
        _usp = _site.getusersitepackages()
        if isinstance(_usp, str):
            _usp = [_usp]
        for _p in _usp:
            if _p and _p not in sys.path:
                sys.path.append(_p)
    except Exception:
        pass
except Exception:
    pass

ns = {"__name__": "__main__"}
for _k, _v in list(globals().items()):
    if not _k.startswith("_"):
        ns[_k] = _v
_CODE = '# cook your dish here\ndef check(px,x):\n if px[1]==x[1]:\n  return (x[2]-px[2])<=(x[0]-px[0]) and (x[2]>=px[2])\n else:\n  return (x[2]-px[2]+1)<=(x[0]-px[0]) and (x[2]>=px[2])\n  \ndef checkdouble(px,x):\n if px[3]==x[3]:\n  return (x[4]-px[4])<=(x[0]-px[0]) and (x[4]>=px[4])\n else:\n  return (x[4]-px[4]+1)<=(x[0]-px[0]) and (x[4]>=px[4])\n  \n\nfor _ in range(int(input())):\n px=[0,1,1,2,1]\n g=True\n for _ in range(int(input())):\n  x=list(map(int,input().split()))\n  if x[1]==x[3] and x[2]==x[4]:\n   g=False\n  if not g:\n   continue\n  g=check(px,x)\n  if g:\n   g=checkdouble(px,x)\n  px=x\n if not g:\n  print("no")\n else:\n  print("yes")\n \n \n \n \n \n \n'
_co = compile(_CODE, USER_FILENAME, "exec")
exec(_co, ns, ns)

```

Measured memory_bytes: 13481