A. Schedule Problem
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

There are $$$n$$$ SWERC candidates in USI and we are going to hold a contest for them. Each of the candidates has a consecutive free period to do the contest. For the $$$i$$$-th candidate, he/she is available from the $$$l_i$$$-th slot to $$$r_i$$$-th slot. The question is, is there a slot that everyone is free so we can do the contest at that time?

Input

The first line contains an integer $$$T(1 \le T \le 10^3)$$$ — the number of test cases. The description of the test cases follows.

For each test case, the first line contains an integer $$$n(1 \le n \le 10^3)$$$ — the number of candidates.

The next $$$n$$$ lines contains two integers $$$l_i,r_i(1 \le l_i \le r_i \le 10^3)$$$ — the free time period of $$$i$$$-th candidate.

It is guaranteed that $$$\sum n \le 10^3$$$ for all test cases.

Output

For each test case, print "YES"(without quotes) in a line if there is at least one slot in which every candidate is available. Otherwise, print "NO"(without quotes) in a line.

You can output "YES" and "NO" in any case (for example, strings "yES", "yes" and "Yes" will be recognized as a positive response).

Example
Input
2
3
1 3
1 2
2 3
3
1 2
2 3
3 4
Output
YES
NO
Note

For the first test case in the sample, everyone is available at slot $$$2$$$.

For the second test case in the sample, there's no slot that everyone is available.