#P1535A. Fair Playoff

    ID: 2110 Type: RemoteJudge 2000ms 256MiB Tried: 0 Accepted: 0 Difficulty: 3 Uploaded By: Tags>brute forceimplementation*800

Fair Playoff

Description

Four players participate in the playoff tournament. The tournament is held according to the following scheme: the first player will play with the second, and the third player with the fourth, then the winners of the pairs will play in the finals of the tournament.

It is known that in a match between two players, the one whose skill is greater will win. The skill of the ii-th player is equal to sis_i and all skill levels are pairwise different (i. e. there are no two identical values in the array ss).

The tournament is called fair if the two players with the highest skills meet in the finals.

Determine whether the given tournament is fair.

The first line contains a single integer tt (1t1041 \le t \le 10^4) — the number of test cases.

A single line of test case contains four integers s1,s2,s3,s4s_1, s_2, s_3, s_4 (1si1001 \le s_i \le 100) — skill of the players. It is guaranteed that all the numbers in the array are different.

For each testcase, output YES if the tournament is fair, or NO otherwise.

Input

The first line contains a single integer tt (1t1041 \le t \le 10^4) — the number of test cases.

A single line of test case contains four integers s1,s2,s3,s4s_1, s_2, s_3, s_4 (1si1001 \le s_i \le 100) — skill of the players. It is guaranteed that all the numbers in the array are different.

Output

For each testcase, output YES if the tournament is fair, or NO otherwise.

Sample Input 1

4
3 7 9 5
4 5 6 9
5 3 8 1
6 5 3 2

Sample Output 1

YES
NO
YES
NO

Note

Consider the example:

  1. in the first test case, players 22 and 33 with skills 77 and 99 advance to the finals;
  2. in the second test case, players 22 and 44 with skills 55 and 99 advance to the finals. The player with skill 66 does not advance, but the player with skill 55 advances to the finals, so the tournament is not fair;
  3. in the third test case, players 11 and 33 with skills 55 and 88 advance to the finals;
  4. in the fourth test case, players 11 and 33 with skills 66 and 33 advance to the finals. The player with skill 55 does not advance, but the player with skill 33 advances to the finals, so the tournament is not fair.