You are given an axis-aligned rectangle in a 2D Cartesian plane. The bottom left corner of this rectangle has coordinates (0,0)$(0, 0)$ and the top right corner has coordinates (N−1,N−1)$(N-1, N-1)$. You are also given K$K$ light sources; each light source is a point inside or on the perimeter of the rectangle.
For each light source, let's divide the plane into four quadrants by a horizontal and a vertical line passing through this light source. The light source can only illuminate one of these quadrants (including its border, i.e. the point containing the light source and two half-lines), but the quadrants illuminated by different light sources may be different.
You want to assign a quadrant to each light source in such a way that when they illuminate their respective quadrants, the entire rectangle (including its perimeter) is illuminated. Find out whether it is possible to assign quadrants to light sources in such a way.

-----Input-----
- The first line of the input contains an integer T$T$ denoting the number of test cases. The description of the test cases follows.
- The first line of each test case contains two space-separated integers K$K$ and N$N$.
- Each of the next K$K$ lines contains two space-separated integers x$x$ and y$y$ denoting a light source with coordinates (x,y)$(x, y)$.

-----Output-----
For each test case, print a single line containing the string "yes" if it is possible to illuminate the whole rectangle or "no" if it is impossible.

-----Constraints-----
- 1≤T≤5,000$1 \le T \le 5,000$
- 1≤K≤100$1 \le K \le 100$
- 1≤N≤109$1 \le N \le 10^9$
- 0≤x,y≤N−1$0 \le x, y \le N-1$
- no two light sources coincide

-----Example Input-----
2
2 10
0 0
1 0
2 10
1 2
1 1

-----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 = "# https://www.codechef.com/problems/RECTLIT\r\n\r\ndef assess(sq,points):\r\n    EWct = 0\r\n    NSct = 0\r\n    for a,b in points:\r\n        EW = (a == 0 or a == sq)\r\n        NS = (b == 0 or b == sq)\r\n        if EW and NS:\r\n            return 'yes'\r\n        EWct += EW\r\n        NSct += NS\r\n    if NSct + EWct == 0 or len(points) == 1:\r\n        return 'no'\r\n    if EWct >= 2 or NSct >= 2:\r\n        return 'yes'\r\n    if len(points) == 2:\r\n        return 'no'\r\n    # now 3 points\r\n    if NSct == 1 and EWct == 1:\r\n        return 'yes'\r\n    # 3 points, one on edge\r\n    x = -1\r\n    for a,b in points:\r\n        if EWct > 0:\r\n            if a == 0 or a == sq:\r\n                e = b\r\n            elif x == -1:\r\n                x = b\r\n            else:\r\n                y = b\r\n        else:\r\n            if b == 0 or b == sq:\r\n                e = a\r\n            elif x == -1:\r\n                x = a\r\n            else:\r\n                y = a\r\n    if (e-x)*(e-y) < 0: # edge splits mids\r\n        return 'no'\r\n    else:\r\n        return 'yes'\r\n\r\n\r\nfor ti in range(int(input())):\r\n    k,n = map(int, input().split())\r\n    if k > 3:\r\n        for ki in range(k):\r\n            input()\r\n        print('yes')\r\n    else:\r\n        pos = [tuple(map(int, input().split())) for ki in range(k)]\r\n        print(assess(n-1,pos))\r\n\r\n"
_co = compile(_CODE, USER_FILENAME, "exec")
exec(_co, ns, ns)

```

Measured memory_bytes: 13207