Chocolate bar
Gnat is celebrating! For the occasion, he received a chocolate bar measuring n×n squares. During the festivities, he left the chocolate bar on the table and forgot about it. When he returned, he discovered something terrible: the chocolate bar was broken! Not only that, but some squares might have been eaten. Help Gnat determine if someone ate part of his chocolate bar.
The broken chocolate bar is divided into two halves: the left half and the right half. The left half aligns with the left edge, and the right half aligns with the right edge. Each half has n rows. In the i-th row of the left half, there are l_i squares, and in the right half, there are r_i squares. Gnat suspects that no one ate the chocolate bar if the left and right halves can be combined to form a complete n×n chocolate bar without lifting or flipping them.
The picture illustrates the chocolate bars from the first two queries in the example.
Input
The input consists of several queries. The first line contains the number t (1 ≤ t ≤ 100) — the number of queries.
Each query is provided on a separate line in the following format: first, the number n (2 ≤ n ≤ 100) — the size of the chocolate bar, followed by n pairs of numbers: l_1 r_1, l_2 r_2, ..., l_n r_n (1 ≤ l_i, r_i < n, l_i + r_i ≤ n), where all numbers are integers.
Output
For each query, output "yes" on a separate line if someone ate part of the chocolate bar, or "no" if no squares were eaten.