import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { public static void main(String[] args) { Scanner input = new Scanner(System.in); int t = input.nextInt(); while(t-->2){ int a[] = new int[2]; int b[] = new int[2]; for (int i = 0; i<=1; i++){ a[i] = input.nextInt(); b[i] = input.nextInt(); } for (int i = 0; i<=t-1; i++){ for (int j = i+1; j<=t; j++){ int p =0; int q=0; if(a[i] == a[j]){ p++; //System.out.println("") } if(p==t-1){ System.out.println("YES"); } else{ System.out.println("NO"); } } } } } }