Lazybones
Student Valera is a classic example of the idler. In classes, he almost did not go, and only appears at the end of the semester at the university and deliver "tails". His dream: to find a day when it will be possible to pass at once all the debts. He has a schedule of work for teachers, of whom know exactly what to and what day of the month, each teacher will be available daily. Help Valera write a program that is scheduled to determine whether Valera pass all debts in one day or not.
Input
The first line contains the number of test cases. Each test consists of a number of items that need to pass Valera. This is followed by lines, each of which consists of two numbers and , specify the interval of the regular teacher.
Output
For each test print in a separate line "YES" if it is possible to meet all the teachers at one day, or "NO", if this is impossible.