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) { /* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */ Scanner in = new Scanner(System.in); int queries = in.nextInt(); for(int i=0; i xset = new HashSet(); Set yset = new HashSet(); for(int j=0; j 2 || yset.size() > 2)System.out.println("NO"); else System.out.println("YES"); } } }