A satellite sent us a photo of a ruin in the middle of a desert. The ruin turns out to be an ancient castle of a forgotten kingdom, roughly 2000 years old. From the photo we can tell that the floor plan of the castle has the shape of a rectilinear polygon.
A rectilinear polygon is a polygon whose edges are all either horizontal or vertical. Equivalently, at every vertex the interior angle between the two incident edges is either 90∘ or 270∘, as shown in Figure 1. A rectilinear polygon is simple when (1) every vertex is incident to exactly two edges and (2) no two edges intersect except at shared end vertices.

Figure 1. (a) A simple rectilinear polygon. (b), (c) Non-simple rectilinear polygons: (b) a vertex has four incident edges; (c) a pair of edges cross each other.
Time has not been kind to the castle. Only its poles remain, that is, the vertices of the simple rectilinear polygon. We must work out how the poles were connected in order to recover the castle's original shape. Figure 2 shows an example.
Formally, you are given a set of n distinct points in the plane with integer coordinates. Decide whether these points can be the vertices of a simple rectilinear polygon, formed by joining all of them with horizontal and vertical segments that alternate around the boundary. Output YES if a simple rectilinear polygon on all n points can be reconstructed, and NO otherwise.

Figure 2. (a) The input points. (b) A simple rectilinear polygon reconstructed from them.
The input is read from standard input. The first line contains the number of test cases T. Each test case begins with a line containing an integer n, the number of points, where 4≤n≤10,000. Each of the next n lines contains two integers, the x- and y-coordinates of one point, each between −106 and 106 inclusive. All points within a test case are distinct.
Write the answer to standard output. Print exactly one line per test case: YES if the points form a simple rectilinear polygon, or NO otherwise.