import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.Stack;
import java.util.StringTokenizer;
import java.util.TreeMap;

public class Main {

    private static PrintWriter out;

    private static void mprintln(Object... ar) {
        for (Object i : ar) {
            out.print(i + " ");
        }
        out.println();
    }

    private static void mprint(Object... ar) {
        for (Object i : ar) {
            out.print(i + " ");
        }
    }

    public static void main(String[] args) throws FileNotFoundException {

        /* Input from file */

        // File inputFile = new File("JavaFile.txt");
        // File outputFile = new File("JavaOutputFile.txt");
        // FileReader fileReader = new FileReader(inputFile);

        /* Here it ends */

        MyScanner sc = new MyScanner(); // Input from console.
        // MyScanner sc = new MyScanner(fileReader); // Input from file.

        out = new PrintWriter(new BufferedOutputStream(System.out)); // Output to console.
        // out = new PrintWriter(new PrintStream(outputFile)); // Output to file.

        int t = sc.ni();
        for (int test = 1; test <= t; ++test)
            getAns(sc);

        out.close();
    }

    /**
     * Don't use built-in function (Math.ceil).
     */
    private static void getAns(MyScanner sc) {
        int x = sc.ni(), y = sc.ni();
        if (x == y) {
            out.println("YES");
            return;
        }

        if (x == 1 || x == 3) {
            out.println("NO");
            return;
        }

        out.println("YES");
    }

    static class MyScanner {

        BufferedReader br;
        StringTokenizer st;

        MyScanner(FileReader fileReader) {
            br = new BufferedReader(fileReader);
        }

        MyScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String nn() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        String nextLine() {
            String ans = "";
            try {
                ans = br.readLine();
            } catch (IOException ex) {
                ex.printStackTrace();
            }
            return ans;
        }

        char nc() {
            return nn().charAt(0);
        }

        int ni() {
            return Integer.parseInt(nn());
        }

        long nl() {
            return Long.parseLong(nn());
        }

        double nd() {
            return Double.parseDouble(nn());
        }

        Integer[] niArr0(int n) {
            Integer[] ar = new Integer[n];
            for (int i = 0; i < n; i++) {
                ar[i] = ni();
            }
            return ar;
        }

        Integer[] niArr1(int n) {
            Integer[] ar = new Integer[n + 1];
            for (int i = 1; i <= n; i++) {
                ar[i] = ni();
            }
            return ar;
        }

        Long[] nlArr0(int n) {
            Long[] ar = new Long[n];
            for (int i = 0; i < n; i++) {
                ar[i] = nl();
            }
            return ar;
        }

        Long[] nlArr1(int n) {
            Long[] ar = new Long[n + 1];
            for (int i = 1; i <= n; i++) {
                ar[i] = nl();
            }
            return ar;
        }
    }
}


import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.Stack;
import java.util.StringTokenizer;
import java.util.TreeMap;

public class Main {

    private static PrintWriter out;

    private static void mprintln(Object... ar) {
        for (Object i : ar) {
            out.print(i + " ");
        }
        out.println();
    }

    private static void mprint(Object... ar) {
        for (Object i : ar) {
            out.print(i + " ");
        }
    }

    public static void main(String[] args) throws FileNotFoundException {

        /* Input from file */

        // File inputFile = new File("JavaFile.txt");
        // File outputFile = new File("JavaOutputFile.txt");
        // FileReader fileReader = new FileReader(inputFile);

        /* Here it ends */

        MyScanner sc = new MyScanner(); // Input from console.
        // MyScanner sc = new MyScanner(fileReader); // Input from file.

        out = new PrintWriter(new BufferedOutputStream(System.out)); // Output to console.
        // out = new PrintWriter(new PrintStream(outputFile)); // Output to file.

        int t = sc.ni();
        for (int test = 1; test <= t; ++test)
            getAns(sc);

        out.close();
    }

    /**
     * Don't use built-in function (Math.ceil).
     */
    private static void getAns(MyScanner sc) {
        int x = sc.ni(), y = sc.ni();
        if (x == y || (x == 2 && y == 3)) {
            out.println("YES");
            return;
        }

        if (x <= 3) {
            out.println("NO");
            return;
        }

        out.println("YES");
    }

    static class MyScanner {

        BufferedReader br;
        StringTokenizer st;

        MyScanner(FileReader fileReader) {
            br = new BufferedReader(fileReader);
        }

        MyScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String nn() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        String nextLine() {
            String ans = "";
            try {
                ans = br.readLine();
            } catch (IOException ex) {
                ex.printStackTrace();
            }
            return ans;
        }

        char nc() {
            return nn().charAt(0);
        }

        int ni() {
            return Integer.parseInt(nn());
        }

        long nl() {
            return Long.parseLong(nn());
        }

        double nd() {
            return Double.parseDouble(nn());
        }

        Integer[] niArr0(int n) {
            Integer[] ar = new Integer[n];
            for (int i = 0; i < n; i++) {
                ar[i] = ni();
            }
            return ar;
        }

        Integer[] niArr1(int n) {
            Integer[] ar = new Integer[n + 1];
            for (int i = 1; i <= n; i++) {
                ar[i] = ni();
            }
            return ar;
        }

        Long[] nlArr0(int n) {
            Long[] ar = new Long[n];
            for (int i = 0; i < n; i++) {
                ar[i] = nl();
            }
            return ar;
        }

        Long[] nlArr1(int n) {
            Long[] ar = new Long[n + 1];
            for (int i = 1; i <= n; i++) {
                ar[i] = nl();
            }
            return ar;
        }
    }
}


import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int t = Integer.parseInt(sc.nextLine());

        for(int i = 0; i < t; i++) {
            String[] s = sc.nextLine().split(" ");
            int x = Integer.parseInt(s[0]);
            int y = Integer.parseInt(s[1]);

           if(x == 1) {
               System.out.println("NO");
           } else {
               int sx = x;
               if(x % 2 != 0) {
                   x--;
               }
               if( (x) * 3 / 2 <= sx) {
                   System.out.println("NO");
               } else
                   System.out.println("YES");
           }
        }
    }

    static P getP(int v) {
        int k = 0;
        while (v % 2 == 0) {
            v = v / 2;
            k++;
        }

        return new P(k, v);
    }

    static class P {
        int k;
        int m;

        public P(int k, int m) {
            this.k = k;
            this.m = m;
        }
    }
}


import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int t = Integer.parseInt(sc.nextLine());

        for(int i = 0; i < t; i++) {
            String[] s = sc.nextLine().split(" ");
            int x = Integer.parseInt(s[0]);
            int y = Integer.parseInt(s[1]);

            if(x == y) {
                System.out.println("yes");
                continue;
            }

           if(x == 1) {
               System.out.println("NO");
           } else {
               int sx = x;
               if(x % 2 != 0) {
                   x--;
               }
               if( (x) * 3 / 2 <= sx + 1) {
                   System.out.println("NO");
               } else
                   System.out.println("YES");
           }
        }
    }

    static P getP(int v) {
        int k = 0;
        while (v % 2 == 0) {
            v = v / 2;
            k++;
        }

        return new P(k, v);
    }

    static class P {
        int k;
        int m;

        public P(int k, int m) {
            this.k = k;
            this.m = m;
        }
    }
}


package r76;

import java.util.Scanner;

public class R76B {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int t = 1;

        for(int i = 0; i < t; i++) {
            String[] s = sc.nextLine().split(" ");
            int x = Integer.parseInt(s[0]);
            int y = Integer.parseInt(s[1]);

           if(x == 1) {
               System.out.println("NO");
           } else {
               if( (x - 1) * 3 / 2 <= x) {
                   System.out.println("NO");
               } else
                   System.out.println("YES");
           }
        }
    }

    static P getP(int v) {
        int k = 0;
        while (v % 2 == 0) {
            v = v / 2;
            k++;
        }

        return new P(k, v);
    }

    static class P {
        int k;
        int m;

        public P(int k, int m) {
            this.k = k;
            this.m = m;
        }
    }
}


import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int t = Integer.parseInt(sc.nextLine());

        for(int i = 0; i < t; i++) {
            String[] s = sc.nextLine().split(" ");
            int x = Integer.parseInt(s[0]);
            int y = Integer.parseInt(s[1]);

           if(x == 1) {
               System.out.println("NO");
           } else {
               if( (x - 1) * 3 / 2 <= x) {
                   System.out.println("NO");
               } else
                   System.out.println("YES");
           }
        }
    }

    static P getP(int v) {
        int k = 0;
        while (v % 2 == 0) {
            v = v / 2;
            k++;
        }

        return new P(k, v);
    }

    static class P {
        int k;
        int m;

        public P(int k, int m) {
            this.k = k;
            this.m = m;
        }
    }
}


import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int t = Integer.parseInt(sc.nextLine());

        for (int i = 0; i < t; i++) {
            String[] s = sc.nextLine().split(" ");
            int x = Integer.parseInt(s[0]);
            int y = Integer.parseInt(s[1]);

            if (x >= y) {
                System.out.println("yes");
                continue;
            }

            if (x == 2 && y == 3) {
                System.out.println("yes");
                continue;
            }

            if (x <= 3) {
                System.out.println("no");
            } else {
                System.out.println("yes");
            }
        }
    }

    static P getP(int v) {
        int k = 0;
        while (v % 2 == 0) {
            v = v / 2;
            k++;
        }

        return new P(k, v);
    }

    static class P {
        int k;
        int m;

        public P(int k, int m) {
            this.k = k;
            this.m = m;
        }
    }
}


import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int t = Integer.parseInt(sc.nextLine());

        for(int i = 0; i < t; i++) {
            String[] s = sc.nextLine().split(" ");
            int x = Integer.parseInt(s[0]);
            int y = Integer.parseInt(s[1]);

            if(x == y) {
                System.out.println("yes");
                continue;
            }

           if(x == 1) {
               System.out.println("NO");
           } else {
               int sx = x;
               if(x % 2 != 0) {
                   x--;
               }
               if( (x) * 3 / 2 <= sx) {
                   System.out.println("NO");
               } else
                   System.out.println("YES");
           }
        }
    }

    static P getP(int v) {
        int k = 0;
        while (v % 2 == 0) {
            v = v / 2;
            k++;
        }

        return new P(k, v);
    }

    static class P {
        int k;
        int m;

        public P(int k, int m) {
            this.k = k;
            this.m = m;
        }
    }
}


import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int t = Integer.parseInt(sc.nextLine());

        for(int i = 0; i < t; i++) {
            String[] s = sc.nextLine().split(" ");
            int x = Integer.parseInt(s[0]);
            int y = Integer.parseInt(s[1]);

            if(x == y) {
                System.out.println("yes");
                continue;
            }

           if(x <= 3) {
               System.out.println("no");
           } else {
               System.out.println("yes");
           }
        }
    }

    static P getP(int v) {
        int k = 0;
        while (v % 2 == 0) {
            v = v / 2;
            k++;
        }

        return new P(k, v);
    }

    static class P {
        int k;
        int m;

        public P(int k, int m) {
            this.k = k;
            this.m = m;
        }
    }
}


import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int t = Integer.parseInt(sc.nextLine());

        for(int i = 0; i < t; i++) {
            String[] s = sc.nextLine().split(" ");
            int x = Integer.parseInt(s[0]);
            int y = Integer.parseInt(s[1]);

            if(x == y) {
                System.out.println("yes");
                continue;
            }

           if(x == 1) {
               System.out.println("NO");
           } else {
               int sx = x;
               if(x % 2 != 0) {
                   x--;
               }

               if(x == sx) {
                   if ((x) * 3 / 2 <= sx) {
                       System.out.println("NO");
                   } else
                       System.out.println("YES");
               } else {
                   if ((x) * 3 / 2 <= sx + 1) {
                       System.out.println("NO");
                   } else
                       System.out.println("YES");
               }
           }
        }
    }

    static P getP(int v) {
        int k = 0;
        while (v % 2 == 0) {
            v = v / 2;
            k++;
        }

        return new P(k, v);
    }

    static class P {
        int k;
        int m;

        public P(int k, int m) {
            this.k = k;
            this.m = m;
        }
    }
}


import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int t = 1;

        for(int i = 0; i < t; i++) {
            String[] s = sc.nextLine().split(" ");
            int x = Integer.parseInt(s[0]);
            int y = Integer.parseInt(s[1]);

           if(x == 1) {
               System.out.println("NO");
           } else {
               if( (x - 1) * 3 / 2 <= x) {
                   System.out.println("NO");
               } else
                   System.out.println("YES");
           }
        }
    }

    static P getP(int v) {
        int k = 0;
        while (v % 2 == 0) {
            v = v / 2;
            k++;
        }

        return new P(k, v);
    }

    static class P {
        int k;
        int m;

        public P(int k, int m) {
            this.k = k;
            this.m = m;
        }
    }
}


import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int t = Integer.parseInt(sc.nextLine());

        for (int i = 0; i < t; i++) {
            String[] s = sc.nextLine().split(" ");
            int x = Integer.parseInt(s[0]);
            int y = Integer.parseInt(s[1]);

            if (x == y) {
                System.out.println("yes");
                continue;
            }

            if (x == 2 && y == 3) {
                System.out.println("yes");
                continue;
            }

            if (x <= 3) {
                System.out.println("no");
            } else {
                System.out.println("yes");
            }
        }
    }

    static P getP(int v) {
        int k = 0;
        while (v % 2 == 0) {
            v = v / 2;
            k++;
        }

        return new P(k, v);
    }

    static class P {
        int k;
        int m;

        public P(int k, int m) {
            this.k = k;
            this.m = m;
        }
    }
}


import java.util.*;
public class B1257 {

	public static void main(String[] args) {
		int t,x,y;
		String conca="";
		Scanner sc  = new Scanner(System.in);

		t=sc.nextInt();
		int flag=0;

		for (int i = 0; i < t; i++) {
			int flag2=0;
			x=sc.nextInt();
			y=sc.nextInt();
			flag=x;
			if(x>=y ) {
				conca+="YES\n";
				continue;
			}
			else if(y%x==0) {
				conca+="NO\n";
				continue;
			}
			while(flag2==0) {
			while(x%2==0) {
				x=3*x/2;
		if(flag==x) {
			conca+="NO\n";
			flag2=1;
			break;

		}
			if(x==y) {
				conca+="YES\n";
			break;
			}

			else if(x>y){
				conca+="YES\n";
			break;
			}

			}
			if(x!=y) {
			x--;
			if(flag==x) {
				conca+="NO\n";
				break;
			}
			}
			}

		}
System.out.println(conca);
	}

}


import java.util.*;
public class B1257 {

	public static void main(String[] args) {
		int t,x,y;
		String conca="";
		Scanner sc  = new Scanner(System.in);

		t=sc.nextInt();
		int flag=0;
		for (int i = 0; i < t; i++) {
			x=sc.nextInt();
			y=sc.nextInt();
			flag=x;
			if(x>=y ) {
				conca+="YES\n";
				continue;
			}
			else if(y%x==0) {
				conca+="NO\n";
				continue;
			}
			while(x<y) {
			while(x%2==0) {
				x=3*x/2;

			if(x==y) {
				conca+="YES\n";
			break;
			}

			else if(x>y){
				conca+="YES\n";
			break;
			}

			}
			if(x!=y) {
			x--;
			if(flag==x) {
				conca+="NO\n";
				break;
			}
			}
			}

		}
System.out.println(conca);
	}

}


import java.util.*;
public class B1257 {

	public static void main(String[] args) {
		int t,x,y;
		String conca="";
		Scanner sc  = new Scanner(System.in);

		t=sc.nextInt();
		int flag=0;

		for (int i = 0; i < t; i++) {
			int flag2=0;
			x=sc.nextInt();
			y=sc.nextInt();
			flag=x;
			if(x>=y ) {
				conca+="YES\n";
				continue;
			}
			else if(y%x==0) {
				conca+="NO\n";
				continue;
			}
			while(flag2==0) {
			while(x%2==0) {
				x=3*x/2;
		if(flag==x) {
			conca+="NO\n";
			flag2=1;
			break;

		}
			if(x>=y) {
				conca+="YES\n";
				flag2=1;
			break;
			}

			}
			if(x!=y) {
			x--;
			if(flag==x) {
				conca+="NO\n";
				break;
			}
			}
			}

		}
System.out.println(conca);
	}

}


import java.util.*;
public class B1257 {

	public static void main(String[] args) {
		long t,x,y;
		String conca="";
		Scanner sc  = new Scanner(System.in);

		t=sc.nextLong();
		long flag=0;

		for (int i = 0; i < t; i++) {
			int flag2=0;
			x=sc.nextLong();
			y=sc.nextLong();
			flag=x;
			if(x==1 && y!=1) {
				conca+="NO\n";
				continue;
			}
			if(x>=y ) {
				conca+="YES\n";
				continue;
			}

			while(x<y) {
			while(x%2==0) {
				x=3*x/2;
		if(flag==x) {
			conca+="NO\n";

			break;

		}
			if(x>=y) {
				conca+="YES\n";

			break;
			}

			}
			if(x!=y) {
			x--;
			if(flag==x) {
				conca+="NO\n";
				break;
			}
			}
			}

		}
System.out.println(conca);
	}

}


import java.util.*;
public class B1257 {

	public static void main(String[] args) {
		long t,x,y;
		String conca="";
		Scanner sc  = new Scanner(System.in);

		t=sc.nextLong();
		long flag=0;

		for (int i = 0; i < t; i++) {
			int flag2=0;
			x=sc.nextLong();
			y=sc.nextLong();
			flag=x;
			if(x==1 && y!=1) {
				conca+="NO\n";
				continue;
			}
			if(x>=y ) {
				conca+="YES\n";
				continue;
			}
			boolean a=true;
			while(x<y) {
			while(x%2==0) {
				x=3*x/2;
		if(flag==x) {
			conca+="NO\n";
			a=false;
			break;

		}
			if(x>=y) {
				conca+="YES\n";
				a=false;
			break;
			}

			}
			if(a) {
			x--;

			}
			else {
				break;
			}
			}

		}
System.out.println(conca);
	}

}


import java.util.*;
public class B1257 {

	public static void main(String[] args) {
		int t,x,y;
		String conca="";
		Scanner sc  = new Scanner(System.in);

		t=sc.nextInt();
		int flag=0;

		for (int i = 0; i < t; i++) {
			int flag2=0;
			x=sc.nextInt();
			y=sc.nextInt();
			flag=x;
			if(x==1 && y!=1) {
				conca+="NO\n";
				continue;
			}
			if(x>=y ) {
				conca+="YES\n";
				continue;
			}

			while(flag2==0) {
			while(x%2==0) {
				x=3*x/2;
		if(flag==x) {
			conca+="NO\n";
			flag2=1;
			break;

		}
			if(x>=y) {
				conca+="YES\n";
				flag2=1;
			break;
			}

			}
			if(x!=y) {
			x--;
			if(flag==x) {
				conca+="NO\n";
				break;
			}
			}
			}

		}
System.out.println(conca);
	}

}


import java.util.*;
public class B1257 {

	public static void main(String[] args) {
		long t,x,y;
		String conca="";
		Scanner sc  = new Scanner(System.in);

		t=sc.nextLong();
		long flag=0;

		for (int i = 0; i < t; i++) {
			int flag2=0;
			x=sc.nextLong();
			y=sc.nextLong();
			flag=x;
			if(x==1 && y!=1) {
				conca+="NO\n";
				continue;
			}
			if(x>=y ) {
				conca+="YES\n";
				continue;
			}

			while(flag2==0) {
			while(x%2==0) {
				x=3*x/2;
		if(flag==x) {
			conca+="NO\n";
			flag2=1;
			break;

		}
			if(x>=y) {
				conca+="YES\n";
				flag2=1;
			break;
			}

			}
			if(x!=y) {
			x--;
			if(flag==x) {
				conca+="NO\n";
				break;
			}
			}
			}

		}
System.out.println(conca);
	}

}


import java.util.*;
public class B1257 {

	public static void main(String[] args) {
		int t,x,y;
		String conca="";
		Scanner sc  = new Scanner(System.in);

		t=sc.nextInt();

		for (int i = 0; i < t; i++) {
			x=sc.nextInt();
			y=sc.nextInt();

			if(y%x==0 && x!=y) {
				conca+="NO\n";
			}

			else {
				conca+="YES\n";
			}

		}
System.out.println(conca);
	}

}


import java.util.*;
public class B1257 {

	public static void main(String[] args) {
		int t,x,y;
		String conca="";
		Scanner sc  = new Scanner(System.in);

		t=sc.nextInt();
		int flag=0;

		for (int i = 0; i < t; i++) {
			int flag2=0;
			x=sc.nextInt();
			y=sc.nextInt();
			flag=x;
			if(x==1 && y!=1) {
				conca+="YES\n";
				continue;
			}
			if(x>=y ) {
				conca+="YES\n";
				continue;
			}

			while(flag2==0) {
			while(x%2==0) {
				x=3*x/2;
		if(flag==x) {
			conca+="NO\n";
			flag2=1;
			break;

		}
			if(x>=y) {
				conca+="YES\n";
				flag2=1;
			break;
			}

			}
			if(x!=y) {
			x--;
			if(flag==x) {
				conca+="NO\n";
				break;
			}
			}
			}

		}
System.out.println(conca);
	}

}


import java.util.*;
public class B1257 {

	public static void main(String[] args) {
		long t,x,y;
		String conca="";
		Scanner sc  = new Scanner(System.in);

		t=sc.nextLong();
		long flag=0;

		for (int i = 0; i < t; i++) {
			int flag2=0;
			x=sc.nextLong();
			y=sc.nextLong();
			flag=x;
			if(x==1 && y!=1) {
				conca+="NO\n";
				continue;
			}
			if(x>=y ) {
				conca+="YES\n";
				continue;
			}
			boolean a=true;
			while(x<y) {
			while(x%2==0) {
				x=3*x/2;
		if(flag==x) {
			conca+="NO\n";
			a=false;
			break;

		}
			if(x>=y) {
				conca+="YES\n";

			break;
			}

			}
			if(a) {
			x--;

			}
			else {
				break;
			}
			}

		}
System.out.println(conca);
	}

}


import java.io.*;
import java.math.*;
import java.security.*;
import java.text.*;
import java.time.LocalTime;
import java.util.*;
import java.util.concurrent.*;
import java.util.regex.*;

public class Main {

    public static void main(String[] args) {

    	FastScanner scan = new FastScanner();

    	int t = scan.nextInt();
    	for(int tt=0; tt<t; tt++) {
    		int x = scan.nextInt(), y = scan.nextInt();
    		if(x >= y ) {
    			System.out.println("YES");
    		}
    		else {
    			if(x == 1 || x== 3 || (x==2 && y != 3)) System.out.println("NO");
    			else System.out.println("YES");
    		}
    	}
    }

    public static void sort(int [] a) {
    	ArrayList<Integer> b = new ArrayList<>();
    	for(int i: a) b.add(i);
    	Collections.sort(b);
    	for(int i=0; i<a.length; i++) a[i]= b.get(i);
    }

    static class FastScanner{

    	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    	StringTokenizer st = new StringTokenizer("");
    	String next() {
    		while(!st.hasMoreTokens())
    			try {
    				st = new StringTokenizer(br.readLine());
    			} catch (IOException e){
    				e.printStackTrace();
    			}
    		return st.nextToken();
    	}

    	int nextInt() {
    		return Integer.parseInt(next());
    	}

    	int [] readArray(int n) {
    		int [] a = new int[n];
    		for(int i=0; i<n ; i++) a[i] = nextInt();
    		return a;
    	}

    	long nextLong() {
    		return Long.parseLong(next());
    	}

    }

}


import java.io.*;
import java.math.*;
import java.security.*;
import java.text.*;
import java.time.LocalTime;
import java.util.*;
import java.util.concurrent.*;
import java.util.regex.*;

public class Main {

    public static void main(String[] args) {

    	FastScanner scan = new FastScanner();

    	int t = scan.nextInt();
    	for(int tt=0; tt<t; tt++) {
    		int x = scan.nextInt(), y = scan.nextInt();
    		if(x >= y ) {
    			System.out.println("YES");
    		}
    		else {
    			if(x == 1 || x== 3) System.out.println("NO");
    			else System.out.println("YES");
    		}
    	}
    }

    public static void sort(int [] a) {
    	ArrayList<Integer> b = new ArrayList<>();
    	for(int i: a) b.add(i);
    	Collections.sort(b);
    	for(int i=0; i<a.length; i++) a[i]= b.get(i);
    }

    static class FastScanner{

    	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    	StringTokenizer st = new StringTokenizer("");
    	String next() {
    		while(!st.hasMoreTokens())
    			try {
    				st = new StringTokenizer(br.readLine());
    			} catch (IOException e){
    				e.printStackTrace();
    			}
    		return st.nextToken();
    	}

    	int nextInt() {
    		return Integer.parseInt(next());
    	}

    	int [] readArray(int n) {
    		int [] a = new int[n];
    		for(int i=0; i<n ; i++) a[i] = nextInt();
    		return a;
    	}

    	long nextLong() {
    		return Long.parseLong(next());
    	}

    }

}


import java.util.*;
public class Main
{
    public static boolean MagicStick(long x,long y,long last_value){
        if(last_value>=y){
                return true;
            }
        if(last_value <1 || last_value==x){
                    return false;
        }
        if(last_value%2 == 0){

                last_value=(last_value*3)/2;
            }
        else{
                last_value=last_value-1;
            }
       return MagicStick(x,y,last_value);
    }
	public static void main(String[] args) {
		Scanner sc = new Scanner (System.in);
        int tests = sc.nextInt();
        for(int i=0;i<tests;i++){
            long x = sc.nextInt();
            long y = sc.nextInt();
            long first=-1,second = -1;
            boolean success=true;
            if(x>=y){
                System.out.println("YES");
                continue;
            }
            if(x%2 == 0){
                first=(x*3)/2;
                if(first==y){
                    System.out.println("YES");
                    continue;
                }
            }
            else{
                first=x-1;
                if(first==y){
                    System.out.println("YES");
                    continue;
                }
            }

            if(MagicStick(x,y,first)){
                    System.out.println("YES");
            }
            else{
                    System.out.println("NO");
            }
        }
	}
}


import java.util.*;
public class Main
{
    public static boolean MagicStick(long x,long y,long last_value){
        if(last_value>=y){
                return true;
            }
        if(last_value <=1 || last_value==x){
                    return false;
        }
        if(last_value%2 == 0){

                last_value=(last_value*3)/2;
            }
        else{
                last_value=last_value-1;
            }
       return MagicStick(x,y,last_value);
    }
	public static void main(String[] args) {
		Scanner sc = new Scanner (System.in);
        int tests = sc.nextInt();
        for(int i=0;i<tests;i++){
            int x = sc.nextInt();
            int y = sc.nextInt();
            long first=-1,second = -1;
            boolean success=true;
            if(x>=y){
                System.out.println("YES");
                continue;
            }
            if(x%2 == 0){
                first=(x*3)/2;
                if(first==y){
                    System.out.println("YES");
                    continue;
                }
            }
            else{
                first=x-1;
                if(first==y){
                    System.out.println("YES");
                    continue;
                }
            }

            if(MagicStick(x,y,first)){
                    System.out.println("YES");
            }
            else{
                    System.out.println("NO");
            }
        }
	}
}


import java.util.*;
public class Main
{
    public static boolean MagicStick(long x,long y,long last_value){
        if(last_value>=y){
                return true;
            }
        if(last_value <1 || last_value==x){
                    return false;
        }
        if(last_value%2 == 0){

                last_value=(last_value*3)/2;
            }
        else{
                last_value=last_value-1;
            }
       return MagicStick(x,y,last_value);
    }
	public static void main(String[] args) {
		Scanner sc = new Scanner (System.in);
        int tests = sc.nextInt();
        for(int i=0;i<tests;i++){
            int x = sc.nextInt();
            int y = sc.nextInt();
            long first=-1,second = -1;
            boolean success=true;
            if(x>=y){
                System.out.println("YES");
                continue;
            }
            if(x%2 == 0){
                first=(x*3)/2;
                if(first==y){
                    System.out.println("YES");
                    continue;
                }
            }
            else{
                first=x-1;
                if(first==y){
                    System.out.println("YES");
                    continue;
                }
            }

            if(MagicStick(x,y,first)){
                    System.out.println("YES");
            }
            else{
                    System.out.println("NO");
            }
        }
	}
}


import java.io.*;
import java.util.*;

public class B
{
	static void solve(FastIO io)
	{
		long x = io.nextInt();
		long y = io.nextInt();
		HashSet<Long> seen = new HashSet<>();

		while (x < y && !seen.contains(x))
		{
			seen.add(x);

			if (x % 2 == 0)
				x = 3 * x / 2;
			else
				x = x - 1;

			if (x >= y)
				break;
		}

		if (x >= y)
			io.println("YES");
		else
			io.println("NO");
	}

	public static void main(String[] args) {
		FastIO io = new FastIO();

		int t = io.nextInt();

		for (int i = 0; i < t; i++)
			solve(io);

		io.close();
	}
}

class FastIO extends PrintWriter
{
	BufferedReader r = new BufferedReader(new InputStreamReader(System.in));
	StringTokenizer st = new StringTokenizer("");

	FastIO()
	{
		super(System.out);
	}

	public String next()
	{
		while (!st.hasMoreTokens())
		{
			try {
				st = new StringTokenizer(r.readLine());
			} catch (Exception e) {
				//TODO: handle exception
			}
		}
		return st.nextToken();
	}

	public int nextInt()
	{
		return Integer.parseInt(next());
	}

	public long nextLong()
	{
		return Long.parseLong(next());
	}

	public double nextDouble()
	{
		return Double.parseDouble(next());
	}
}


import java.io.*;
import java.util.*;

public class B
{
	static void solve(FastIO io)
	{
		int x = io.nextInt();
		int y = io.nextInt();

		HashSet<Long> seen = new HashSet<>();
		ArrayDeque<Long> q = new ArrayDeque<>();

		seen.add((long)x);
		q.add((long)x);

		while (!q.isEmpty())
		{
			long k = q.remove();

			if (k == y)
			{
				io.println("YES");
				return;
			}

			if (k % 2 == 0 && !seen.contains(3 * k /2 ))
			{

				q.add(3 * k / 2);
				seen.add(3 * k / 2);
			}
			else if (k % 2 == 1 && !seen.contains(k - 1))
			{
				q.add(k - 1);
				seen.add(k - 1);
			}
		}

		io.println("NO");
	}

	public static void main(String[] args) {
		FastIO io = new FastIO();

		int t = io.nextInt();

		for (int i = 0; i < t; i++)
			solve(io);

		io.close();
	}
}

class FastIO extends PrintWriter
{
	BufferedReader r = new BufferedReader(new InputStreamReader(System.in));
	StringTokenizer st = new StringTokenizer("");

	FastIO()
	{
		super(System.out);
	}

	public String next()
	{
		while (!st.hasMoreTokens())
		{
			try {
				st = new StringTokenizer(r.readLine());
			} catch (Exception e) {
				//TODO: handle exception
			}
		}
		return st.nextToken();
	}

	public int nextInt()
	{
		return Integer.parseInt(next());
	}

	public long nextLong()
	{
		return Long.parseLong(next());
	}

	public double nextDouble()
	{
		return Double.parseDouble(next());
	}
}


import java.util.*;
public class div2_1257b_MagicStick {

	public static void main(String[] args) {
		Scanner scn = new Scanner(System.in);
		int t=scn.nextInt();
		while(t-- !=0) {
			long x=scn.nextLong();
			long y=scn.nextLong();
			if(x==2 || x==3) {
				if(y==3)
					System.out.println("YES");
				else
					System.out.println("NO");
			}else if(x==1 && y!=1) {
				System.out.println("NO");
			}
			else {

				System.out.println("YES");
			}
		}
	}

}


import java.util.*;

public class div2_1257b_MagicStick {

	public static void main(String[] args) {
		Scanner scn = new Scanner(System.in);
		int t=scn.nextInt();
		while(t-- !=0) {
			long x=scn.nextLong();
			long y=scn.nextLong();
			if(x==2 || x==3) {
				if(y==3||y==2||y==1)
					System.out.println("YES");
				else
					System.out.println("NO");
			}
			else if(x==1 && y!=1) {
				System.out.println("NO");
			}
			else {

				System.out.println("YES");
			}
		}
	}

}


import java.util.*;

public class div2_1257b_MagicStick {

	public static void main(String[] args) {
		Scanner scn = new Scanner(System.in);
		int t=scn.nextInt();
		while(t-- !=0) {
			long x=scn.nextLong();
			long y=scn.nextLong();
			if(x==2 || x==3) {
				if(y==3 || y==2)
					System.out.println("YES");
				else
					System.out.println("NO");
			}else if(x==1 && y!=1) {
				System.out.println("NO");
			}
			else {

				System.out.println("YES");
			}
		}
	}

}


public class div2_1257b_MagicStick {

	public static void main(String[] args) {
		Scanner scn = new Scanner(System.in);
		int t=scn.nextInt();
		while(t-- !=0) {
			long x=scn.nextLong();
			long y=scn.nextLong();
			if(x==2 || x==3) {
				if(y==3)
					System.out.println("YES");
				else
					System.out.println("NO");
			}else if(x==1 && y!=1) {
				System.out.println("NO");
			}
			else {

				System.out.println("YES");
			}
		}
	}

}


import java.util.*;
import java.io.*;

public class B{

    public static void main(String[] args) throws IOException {

        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        BufferedWriter out = new BufferedWriter(new OutputStreamWriter(System.out));

        int cases = Integer.parseInt(in.readLine());

        for (int i = 0; i < cases; i++){
            StringTokenizer skt = new StringTokenizer(in.readLine());

            int a = Integer.parseInt(skt.nextToken());
            int b = Integer.parseInt(skt.nextToken());

            out.write(a>=b?"YES\n":"NO\n");

        }
        out.close();
    }
}


import java.util.*;
import java.io.*;

public class B{

    public static void main(String[] args) throws IOException {

        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        BufferedWriter out = new BufferedWriter(new OutputStreamWriter(System.out));

        int cases = Integer.parseInt(in.readLine());

        for (int i = 0; i < cases; i++){
            StringTokenizer skt = new StringTokenizer(in.readLine());

            long a = Long.parseLong(skt.nextToken());
            long b = Long.parseLong(skt.nextToken());

            if (a>=b){
                out.write("YES\n");
            }
            else{
                if (a==2 & b==3){
                    out.write("YES\n");
                }
                else if (a==2 || a == 3 || a==1){
                    out.write("NO\n");
                }
                else{
                    out.write("YES\n");
                }
            }

        }
        out.close();
    }
}


import java.util.*;
import java.io.*;

public class B{

    public static void main(String[] args) throws IOException {

        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        BufferedWriter out = new BufferedWriter(new OutputStreamWriter(System.out));

        int cases = Integer.parseInt(in.readLine());

        for (int i = 0; i < cases; i++){
            StringTokenizer skt = new StringTokenizer(in.readLine());

            int a = Integer.parseInt(skt.nextToken());
            int b = Integer.parseInt(skt.nextToken());

            out.write(a>=b?"YES\n":"NO\n");

        }

    }
}


//package codeforces.div2;

import java.util.Scanner;

public class MagicStick {

    static public void print(int a, int b) {

        if(a == b) {
            System.out.println("YES");
        } else {
            if (a == 1 && b == 1) {
                System.out.println("YES");
            } else {
                if (a == 1 && b != 1) {
                    System.out.println("NO");
                } else {
                    if (a == 3 && b == 1) {
                        System.out.println("YES");
                    } else {
                        if (a == 3 && b == 2) {
                            System.out.println("YES");
                        } else {
                            if (a == 3) {
                                System.out.println("NO");
                            } else {
                                if (a == 2 && (b == 1 || b == 2)) {
                                    System.out.println("YES");
                                } else {
                                    if (a == 2 && b == 3) {
                                        System.out.println("YES");
                                    } else {
                                        if (a == 2) {
                                            System.out.println("NO");
                                        } else {
                                            System.out.println("YES");
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }

    public static void main(String []args) {

        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        while ( n > 0) {
            int a = sc.nextInt();
            int b = sc.nextInt();
            print(a, b);
            n--;
        }
    }
}


//package codeforces.div2;

import java.util.Scanner;

public class MagicStick {

    static public void print(int a, int b) {

        if(a == 1 && b == 1 ) {
            System.out.println("YES");
        } else {
            if(a == 1 && b!=1) {
                System.out.println("NO");
            } else {
                if(a == 3 && b == 1) {
                    System.out.println("YES");
                } else {
                    if(a == 3 && b == 2) {
                        System.out.println("YES");
                    } else {
                        if(a == 3) {
                            System.out.println("NO");
                        } else {
                            System.out.println("YES");
                        }
                    }
                }
            }
        }
    }

    public static void main(String []args) {

        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        while ( n > 0) {
            int a = sc.nextInt();
            int b = sc.nextInt();
            print(a, b);
            n--;
        }
    }
}


//package codeforces.div2;

import java.util.Scanner;

public class MagicStick {

    static public void print(int a, int b) {

        if(a == 1 && b == 1 ) {
            System.out.println("YES");
        } else {
            if(a == 1 && b!=1) {
                System.out.println("NO");
            } else {
                if(a == 3 && b == 1) {
                    System.out.println("YES");
                } else {
                    if(a == 3 && b == 2) {
                        System.out.println("YES");
                    } else {
                        if(a == 3) {
                            System.out.println("NO");
                        } else {
                            if(a == 2 && (b == 1 || b == 2)) {
                                System.out.println("YES");
                            } else {
                                if(a == 2 && b == 3) {
                                    System.out.println("YES");
                                } else {
                                    if(a == 2) {
                                        System.out.println("NO");
                                    } else {
                                        System.out.println("YES");
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }

    public static void main(String []args) {

        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        while ( n > 0) {
            int a = sc.nextInt();
            int b = sc.nextInt();
            print(a, b);
            n--;
        }
    }
}


//package codeforces.div2;

import java.util.Scanner;

public class MagicStick {

    static public void print(int a, int b) {

        if(a == 1 && b == 1 ) {
            System.out.println("YES");
        } else {
            if(a == 1 && b!=1) {
                System.out.println("NO");
            } else {
                if(a == 3 && b == 1) {
                    System.out.println("YES");
                } else {
                    if(a == 3 && b == 2) {
                        System.out.println("YES");
                    } else {
                        if(a == 3) {
                            System.out.println("NO");
                        } else {
                            if(a == 2 && b == 1) {
                                System.out.println("YES");
                            } else {
                                if(a == 2 && b == 3) {
                                    System.out.println("YES");
                                } else {
                                    if(a == 2) {
                                        System.out.println("NO");
                                    } else {
                                        System.out.println("YES");
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }

    public static void main(String []args) {

        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        while ( n > 0) {
            int a = sc.nextInt();
            int b = sc.nextInt();
            print(a, b);
            n--;
        }
    }
}


import java.util.Scanner;

public class _1257B {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int t = sc.nextInt();
        while (t-- > 0) {
            int a = sc.nextInt();
            int b = sc.nextInt();
            int p = a; int f=1;
            if (a == b) {
                System.out.println("YES");
            }
            else {
                if (a % 2 != 0) {
                    a -= 1;
                    f=0;
                    if ((3 * a) / 2 == p || a == 0)
                        System.out.println("NO");
                    else f=1;
                }
                if(f==1) System.out.println("YES");
            }

        }
    }
}


import java.util.Scanner;

public class _1257B {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int t = sc.nextInt();
        while (t-- > 0) {
            int a = sc.nextInt();
            int b = sc.nextInt();
            if (a >= b || a == 2 && b == 3)
                System.out.println("YES");
            else {
                if (a==2||a == 3 || a == 1) System.out.println("NO");
                else System.out.println("YES");
            }
        }
    }
}


import java.util.Scanner;

public class _1257B {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int t = sc.nextInt();
        while (t-- > 0) {
            int a = sc.nextInt();
            int b = sc.nextInt();
            if (a >= b || a == 2 && b == 3)
                System.out.println("YES");
            else {
                if (a == 3 || a == 1) System.out.println("NO");
                else System.out.println("YES");
            }
        }
    }
}


import java.util.Scanner;

public class _1257B {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int t = sc.nextInt();
        while (t-- > 0) {
            int a = sc.nextInt();
            int b = sc.nextInt();
            if (a >= b || a == 2 && b == 3)
                System.out.println("YES");
            else {
                if (a != 3 && a != 1) System.out.println("YES");
                else System.out.println("NO");
            }
        }
    }
}


//make sure to make new file!
import java.io.*;
import java.util.*;

public class B76{

   public static void main(String[] args)throws IOException{
      BufferedReader f = new BufferedReader(new InputStreamReader(System.in));
      PrintWriter out = new PrintWriter(System.out);

      int t = Integer.parseInt(f.readLine());

      for(int q = 1; q <= t; q++){

         StringTokenizer st = new StringTokenizer(f.readLine());

         int n = Integer.parseInt(st.nextToken());
         int m = Integer.parseInt(st.nextToken());

         if(n < m && n <= 3 && (n!=2 || m != 3)){
            out.println("NO");
         } else {
            out.println("YES");
         }

      }

      out.close();
   }

}


//make sure to make new file!
import java.io.*;
import java.util.*;

public class B76{

   public static void main(String[] args)throws IOException{
      BufferedReader f = new BufferedReader(new InputStreamReader(System.in));
      PrintWriter out = new PrintWriter(System.out);

      int t = Integer.parseInt(f.readLine());

      for(int q = 1; q <= t; q++){

         StringTokenizer st = new StringTokenizer(f.readLine());

         int n = Integer.parseInt(st.nextToken());
         int m = Integer.parseInt(st.nextToken());

         if(n < m && n <= 3 || (n==2 && m == 3)){
            out.println("NO");
         } else {
            out.println("YES");
         }

      }

      out.close();
   }

}


//make sure to make new file!
import java.io.*;
import java.util.*;

public class B76{

   public static void main(String[] args)throws IOException{
      BufferedReader f = new BufferedReader(new InputStreamReader(System.in));
      PrintWriter out = new PrintWriter(System.out);

      int t = Integer.parseInt(f.readLine());

      for(int q = 1; q <= t; q++){

         StringTokenizer st = new StringTokenizer(f.readLine());

         int n = Integer.parseInt(st.nextToken());
         int m = Integer.parseInt(st.nextToken());

         if(n < m && n <= 3 && (n!=2 && m != 3)){
            out.println("NO");
         } else {
            out.println("YES");
         }

      }

      out.close();
   }

}


import java.io.*;
import java.util.*;
import java.math.*;

public class Main{
	public static void main(String[] args) throws Exception {
	IO io = new IO();
	PrintWriter out = new PrintWriter(System.out);
	Solver sr = new Solver();
	sr.solve(io,out);
	out.flush();
	out.close();
    	}

	static class Solver
	{
	    void solve(IO io, PrintWriter out)
	    {
           int i, j;
           int t=io.nextInt();
           while(t-->0)
           {
               long a = io.nextLong();
               long b = io.nextLong();

               if(a>=b)
                   {
                       out.println("Yes");
                       continue;
                   }
                 int flag=0;
               while(a<b){
                   if(a%2==0)
                   {
                       if(3*a>2*a)
                            a=3*a/2;
                        else
                        {
                            out.println("No");
                            flag=1;
                            break;
                        }
                   }
                   else
                   {
                       if(3*(a-1)>2*a)
                            a=3*(a-1)/2;
                        else
                        {
                            out.println("No");
                            flag=1;
                            break;
                        }
                   }
               }
               if(flag!=1 && a>=b)
                    out.println("Yes");

           }

	    }

	}
	//Special thanks to Petr (on codeforces) who inspired me to implement IO class!
	static class IO
	{
    	BufferedReader reader;
        StringTokenizer tokenizer;
    	public IO() {
                reader = new BufferedReader(new InputStreamReader(System.in));
                tokenizer = null;
            }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }
        public String nextLine() {
            String s="";
            try {
                    s=reader.readLine();
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            return s;
        }
        public int nextInt() {
            return Integer.parseInt(next());
        }

        public long nextLong() {
            return Long.parseLong(next());
        }
    	double nextDouble()
    	{
    		return Double.parseDouble(next());
    	}
	}
}


import java.io.*;
import java.util.*;
import java.math.*;

public class Main{
	public static void main(String[] args) throws Exception {
	IO io = new IO();
	PrintWriter out = new PrintWriter(System.out);
	Solver sr = new Solver();
	sr.solve(io,out);
	out.flush();
	out.close();
    	}

	static class Solver
	{
	    void solve(IO io, PrintWriter out)
	    {
           int i, j;
           int t=io.nextInt();
           while(t-->0)
           {
               int a = io.nextInt();
               int b = io.nextInt();

               if(a>=b)
               {
                   out.println("Yes");
                   continue;
               }
               if(a%2==0)
               {
                   if(3*a>2*a)
                        out.println("Yes");
                    else
                        out.println("No");
               }
               else
               {
                   if(3*(a-1)>2*a)
                        out.println("Yes");
                    else
                        out.println("No");
               }
           }

	    }

	}
	//Special thanks to Petr (on codeforces) who inspired me to implement IO class!
	static class IO
	{
    	BufferedReader reader;
        StringTokenizer tokenizer;
    	public IO() {
                reader = new BufferedReader(new InputStreamReader(System.in));
                tokenizer = null;
            }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }
        public String nextLine() {
            String s="";
            try {
                    s=reader.readLine();
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            return s;
        }
        public int nextInt() {
            return Integer.parseInt(next());
        }

        public long nextLong() {
            return Long.parseLong(next());
        }
    	double nextDouble()
    	{
    		return Double.parseDouble(next());
    	}
	}
}


import java.io.*;
import java.util.*;
import java.math.*;

public class Main{
	public static void main(String[] args) throws Exception {
	IO io = new IO();
	PrintWriter out = new PrintWriter(System.out);
	Solver sr = new Solver();
	sr.solve(io,out);
	out.flush();
	out.close();
    	}

	static class Solver
	{
	    void solve(IO io, PrintWriter out)
	    {
           int i, j;
           int t=io.nextInt();
           while(t-->0)
           {
               int a = io.nextInt();
               int b = io.nextInt();

               if(a>=b)
                   {
                       out.println("Yes");
                       continue;
                   }
                 int flag=0;
               while(a<b){
                   if(a%2==0)
                   {
                       if(3*a>2*a)
                            a=3*a/2;
                        else
                        {
                            out.println("No");
                            flag=1;
                            break;
                        }
                   }
                   else
                   {
                       if(3*(a-1)>2*a)
                            a=3*(a-1)/2;
                        else
                        {
                            out.println("No");
                            flag=1;
                            break;
                        }
                   }
               }
               if(flag!=1)
                    out.println("Yes");

           }

	    }

	}
	//Special thanks to Petr (on codeforces) who inspired me to implement IO class!
	static class IO
	{
    	BufferedReader reader;
        StringTokenizer tokenizer;
    	public IO() {
                reader = new BufferedReader(new InputStreamReader(System.in));
                tokenizer = null;
            }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }
        public String nextLine() {
            String s="";
            try {
                    s=reader.readLine();
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            return s;
        }
        public int nextInt() {
            return Integer.parseInt(next());
        }

        public long nextLong() {
            return Long.parseLong(next());
        }
    	double nextDouble()
    	{
    		return Double.parseDouble(next());
    	}
	}
}


import java.util.*;
import java.lang.*;
import java.io.*;

public class Main
{
	//Fast IO class
    static class FastReader
    {
        BufferedReader br;
        StringTokenizer st;
        public FastReader()
        {
        	boolean env=System.getProperty("ONLINE_JUDGE") != null;
        	if(!env) {
        		try {
					br=new BufferedReader(new FileReader("src\\input.txt"));
				} catch (FileNotFoundException e) {
					e.printStackTrace();
				}
        	}
        	else {
        		br = new BufferedReader(new
                        InputStreamReader(System.in));
        	}
        }
        String next()
        {
            while (st == null || !st.hasMoreElements())
            {
                try
                {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException  e)
                {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
        int nextInt()
        {
            return Integer.parseInt(next());
        }
        long nextLong()
        {
            return Long.parseLong(next());
        }
        double nextDouble()
        {
            return Double.parseDouble(next());
        }
        String nextLine()
        {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }
    }
    static long MOD=1000000000+7;
    //Euclidean Algorithm
    static long gcd(long A,long B){
        if(B==0) return A;
        return gcd(B,A%B);
    }
    //Modular Exponentiation
    static long fastExpo(long x,long n){
        if(n==0) return 1;
        if((n&1)==0) return fastExpo((x*x)%MOD,n/2)%MOD;
        return ((x%MOD)*fastExpo((x*x)%MOD,(n-1)/2))%MOD;
    }
    //Prime Number Algorithm
    static boolean isPrime(long n){
        if(n<=1) return false;
        if(n<=3) return true;
        if(n%2==0 || n%3==0) return false;
        for(int i=5;i*i<=n;i+=6)
            if(n%i==0 || n%(i+2)==0) return false;
        return true;
    }
    //Sieve of eratosthenes
    static int[] findPrimes(int n){
        boolean isPrime[]=new boolean[n+1];
        ArrayList<Integer> a=new ArrayList<>();
        int result[];
        Arrays.fill(isPrime,true);
        isPrime[0]=false;
        isPrime[1]=false;
        for(int i=2;i*i<=n;++i)
            if(isPrime[i]==true)
                for(int j=i*i;j<=n;j+=i) isPrime[j]=false;
        for(int i=0;i<=n;i++) if(isPrime[i]==true) a.add(i);
        result=new int[a.size()];
        for(int i=0;i<a.size();i++) result[i]=a.get(i);
        return result;
    }
    // Pair
    static class pair{
    	long x,y;
    	pair(long a,long b){
    		this.x=a;
    		this.y=b;
    	}
    	public boolean equals(Object obj) {
    		if(obj == null || obj.getClass()!= this.getClass())
                return false;
            pair p = (pair) obj;
            return (this.x==p.x && this.y==p.y);
        }
    	public int hashCode() {
            return Objects.hash(x,y);
        }
    }
    //Main function(The main code starts from here)
    public static void main (String[] args) throws java.lang.Exception
    {
        FastReader sc=new FastReader();
        //PrintWriter out = new PrintWriter(System.out);
    	int test=sc.nextInt();
        while(test-->0) {
        	long x=sc.nextLong(),y=sc.nextLong();
        	if((x==1 && y>1) ||(x==3 || x==2 && y>3)) System.out.println("NO");
        	else System.out.println("YES");

        }
    }
}


import java.util.*;
import java.lang.*;
import java.io.*;

public class Main
{
	//Fast IO class
    static class FastReader
    {
        BufferedReader br;
        StringTokenizer st;
        public FastReader()
        {
        	boolean env=System.getProperty("ONLINE_JUDGE") != null;
        	if(!env) {
        		try {
					br=new BufferedReader(new FileReader("src\\input.txt"));
				} catch (FileNotFoundException e) {
					e.printStackTrace();
				}
        	}
        	else {
        		br = new BufferedReader(new
                        InputStreamReader(System.in));
        	}
        }
        String next()
        {
            while (st == null || !st.hasMoreElements())
            {
                try
                {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException  e)
                {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
        int nextInt()
        {
            return Integer.parseInt(next());
        }
        long nextLong()
        {
            return Long.parseLong(next());
        }
        double nextDouble()
        {
            return Double.parseDouble(next());
        }
        String nextLine()
        {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }
    }
    static long MOD=1000000000+7;
    //Euclidean Algorithm
    static long gcd(long A,long B){
        if(B==0) return A;
        return gcd(B,A%B);
    }
    //Modular Exponentiation
    static long fastExpo(long x,long n){
        if(n==0) return 1;
        if((n&1)==0) return fastExpo((x*x)%MOD,n/2)%MOD;
        return ((x%MOD)*fastExpo((x*x)%MOD,(n-1)/2))%MOD;
    }
    //Prime Number Algorithm
    static boolean isPrime(long n){
        if(n<=1) return false;
        if(n<=3) return true;
        if(n%2==0 || n%3==0) return false;
        for(int i=5;i*i<=n;i+=6)
            if(n%i==0 || n%(i+2)==0) return false;
        return true;
    }
    //Sieve of eratosthenes
    static int[] findPrimes(int n){
        boolean isPrime[]=new boolean[n+1];
        ArrayList<Integer> a=new ArrayList<>();
        int result[];
        Arrays.fill(isPrime,true);
        isPrime[0]=false;
        isPrime[1]=false;
        for(int i=2;i*i<=n;++i)
            if(isPrime[i]==true)
                for(int j=i*i;j<=n;j+=i) isPrime[j]=false;
        for(int i=0;i<=n;i++) if(isPrime[i]==true) a.add(i);
        result=new int[a.size()];
        for(int i=0;i<a.size();i++) result[i]=a.get(i);
        return result;
    }
    // Pair
    static class pair{
    	long x,y;
    	pair(long a,long b){
    		this.x=a;
    		this.y=b;
    	}
    	public boolean equals(Object obj) {
    		if(obj == null || obj.getClass()!= this.getClass())
                return false;
            pair p = (pair) obj;
            return (this.x==p.x && this.y==p.y);
        }
    	public int hashCode() {
            return Objects.hash(x,y);
        }
    }
    //Main function(The main code starts from here)
    public static void main (String[] args) throws java.lang.Exception
    {
        FastReader sc=new FastReader();
        //PrintWriter out = new PrintWriter(System.out);
    	int test=sc.nextInt();
        while(test-->0) {
        	long x=sc.nextLong(),y=sc.nextLong();
        	if((x==1 && y>1) ||((x==3 || x==2) && y>3)) System.out.println("NO");
        	else System.out.println("YES");

        }
    }
}


import java.util.*;
import java.lang.*;
import java.io.*;

public class Main
{
	//Fast IO class
    static class FastReader
    {
        BufferedReader br;
        StringTokenizer st;
        public FastReader()
        {
        	boolean env=System.getProperty("ONLINE_JUDGE") != null;
        	if(!env) {
        		try {
					br=new BufferedReader(new FileReader("src\\input.txt"));
				} catch (FileNotFoundException e) {
					e.printStackTrace();
				}
        	}
        	else {
        		br = new BufferedReader(new
                        InputStreamReader(System.in));
        	}
        }
        String next()
        {
            while (st == null || !st.hasMoreElements())
            {
                try
                {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException  e)
                {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
        int nextInt()
        {
            return Integer.parseInt(next());
        }
        long nextLong()
        {
            return Long.parseLong(next());
        }
        double nextDouble()
        {
            return Double.parseDouble(next());
        }
        String nextLine()
        {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }
    }
    static long MOD=1000000000+7;
    //Euclidean Algorithm
    static long gcd(long A,long B){
        if(B==0) return A;
        return gcd(B,A%B);
    }
    //Modular Exponentiation
    static long fastExpo(long x,long n){
        if(n==0) return 1;
        if((n&1)==0) return fastExpo((x*x)%MOD,n/2)%MOD;
        return ((x%MOD)*fastExpo((x*x)%MOD,(n-1)/2))%MOD;
    }
    //Prime Number Algorithm
    static boolean isPrime(long n){
        if(n<=1) return false;
        if(n<=3) return true;
        if(n%2==0 || n%3==0) return false;
        for(int i=5;i*i<=n;i+=6)
            if(n%i==0 || n%(i+2)==0) return false;
        return true;
    }
    //Sieve of eratosthenes
    static int[] findPrimes(int n){
        boolean isPrime[]=new boolean[n+1];
        ArrayList<Integer> a=new ArrayList<>();
        int result[];
        Arrays.fill(isPrime,true);
        isPrime[0]=false;
        isPrime[1]=false;
        for(int i=2;i*i<=n;++i)
            if(isPrime[i]==true)
                for(int j=i*i;j<=n;j+=i) isPrime[j]=false;
        for(int i=0;i<=n;i++) if(isPrime[i]==true) a.add(i);
        result=new int[a.size()];
        for(int i=0;i<a.size();i++) result[i]=a.get(i);
        return result;
    }
    // Pair
    static class pair{
    	long x,y;
    	pair(long a,long b){
    		this.x=a;
    		this.y=b;
    	}
    	public boolean equals(Object obj) {
    		if(obj == null || obj.getClass()!= this.getClass())
                return false;
            pair p = (pair) obj;
            return (this.x==p.x && this.y==p.y);
        }
    	public int hashCode() {
            return Objects.hash(x,y);
        }
    }
    //Main function(The main code starts from here)
    public static void main (String[] args) throws java.lang.Exception
    {
        FastReader sc=new FastReader();
        //PrintWriter out = new PrintWriter(System.out);
    	int test=sc.nextInt();
        while(test-->0) {
        	long x=sc.nextLong(),y=sc.nextLong();
        	if((x==1 && y!=1) ||(x==3 || x==2 && y>3)) System.out.println("NO");
        	else System.out.println("YES");

        }
    }
}


import java.util.*;
public class Solution2
{
    public static void main(String... args)
    {
        int t, x, y;
        Scanner scan = new Scanner(System.in);
        t = scan.nextInt();
        for(int i=0 ; i<t ; i++)
        {
            x = scan.nextInt();
            y = scan.nextInt();

            if(x==y)
            {
                System.out.println("YES");
                continue;
            }
            else if((x==2 && (y==3)) || (x==2 && (y==1)))
            {
                System.out.println("YES");
            }
            else if((x==1) || (x==3 && y!=2))
            {
                System.out.println("NO");

            }
            else{
                System.out.println("YES");
            }
        }
    }
}


import java.util.*;
public class Solution2
{
    public static void main(String... args)
    {
        int t, x, y;
        Scanner scan = new Scanner(System.in);
        t = scan.nextInt();
        for(int i=0 ; i<t ; i++)
        {
            x = scan.nextInt();
            y = scan.nextInt();

            if(x==y)
            {
                System.out.println("YES");
                continue;
            }
            if((x==1) || (x==3 && y!=2) || (x==2 && y!=3))
            {
                System.out.println("NO");

            }
            else{
                System.out.println("YES");
            }
        }
    }
}


import java.util.*;
public class Solution2
{
    public static void main(String... args)
    {
        int t, x, y;
        Scanner scan = new Scanner(System.in);
        t = scan.nextInt();
        for(int i=0 ; i<t ; i++)
        {
            x = scan.nextInt();
            y = scan.nextInt();

           if(x==y)
           {
                System.out.println("YES");
                continue;
           }
           else if(x==1)
           {
                System.out.println("NO");
                continue;
           }
           else if(x==2 && !(y==1 || y==3))
           {
                System.out.println("NO");
                continue;
           }
           else if(x==3 && !(y==2 || y==1))
           {
                System.out.println("NO");
                continue;
           }
           else
           {
                System.out.println("YES");
           }
            // if(x==y)
            // {
            //     System.out.println("YES");
            //     continue;
            // }
            // else if((x==2 && (y==3)) || (x==2 && (y==1)))
            // {
            //     System.out.println("YES");
            // }
            // else if((x==1) || (x==3 && y!=2))
            // {
            //     System.out.println("NO");

            // }
            // else{
            //     System.out.println("YES");
            // }
        }
    }
}


import java.util.*;
public class Solution2
{
    public static void main(String... args)
    {
        int t, x, y;
        Scanner scan = new Scanner(System.in);
        for(int i=0 ; i<t ; i++)
        {
            x = scan.nextInt();
            y = scan.nextInt();

            if(x==y)
            {
                System.out.println("YES");
                continue;
            }
            if((x==1) || (x==3 && y!=2) || (x==2 && y!=3))
            {
                System.out.println("NO");

            }
            else{
                System.out.println("YES");
            }
        }
    }
}


import java.util.Scanner;

public class Main
{
    public static void main (String[] args) throws java.lang.Exception
    {
        // your code goes here

        Scanner scn = new Scanner(System.in);
        String input;
        int counter = 0;

        counter = Integer.parseInt(scn.nextLine().trim());
        int x,y;
        String line[];

        while(counter>0) {
            counter--;
            line = scn.nextLine().split(" ");
            x = Integer.parseInt(line[0]);
            y = Integer.parseInt(line[1]);

            if(x>=y || 3*(x/2)>x) {
                System.out.println("YES");
                continue;
            }

            System.out.println("NO");

        }
    }
}


import java.util.Scanner;

public class Main
{
    public static void main (String[] args) throws java.lang.Exception
    {
        // your code goes here

        Scanner scn = new Scanner(System.in);
        String input;
        int counter = 0;

        counter = Integer.parseInt(scn.nextLine().trim());
        int x,y;
        String line[];
        int number;

        while(counter>0) {
            counter--;
            line = scn.nextLine().split(" ");
            x = Integer.parseInt(line[0]);
            y = Integer.parseInt(line[1]);

            if(x>=y) {
                System.out.println("YES");
                continue;
            }

            number = 3*(x/2);
            if(number==y){
                System.out.println("YES");
                continue;
            }
            if(number%2==0 && number > x){
                System.out.println("YES");
                continue;
            }

            if(number%2==1 && number > (x+1)){
                System.out.println("YES");
                continue;
            }

            System.out.println("NO");

        }
    }
}


n = int(raw_input().strip())
ans = [4*4] * n

for i in range(4*n):
    if i%4 == 0: coords = [[] for _ in range(4)]
    x,y,a,b = map(int, raw_input().strip().split())
    coords[i%4] += [complex(x,y)]
    for _ in range(3):
        x, y = a - (y - b), b + (x - a)
        coords[i%4] += [complex(x,y)]
    if i%4 == 3:
        for b in range(4**4):
            cb = [(b / 4**p)%4 for p in range(4)]
            verts = []
            for j in range(4):
              p = coords[j][cb[j]]
              if p in verts: continue
              verts += [p]
            if len(verts) < 4: continue
            edges = [verts[j] - verts[0] for j in range(1, 4)]
            lensq = sorted([abs(e*e.conjugate()) for e in edges])
            if lensq[0] == 0: continue
            if lensq[0] == lensq[1] and lensq[2] == 2*lensq[0]:
                ans[i//4] = min(ans[i//4], sum(cb))
for i in range(n):
    if ans[i] == 16: print -1
    else: print ans[i]


n = int(raw_input().strip())
ans = [4*4] * n

for i in range(4*n):
    if i%4 == 0: coords = [[] for _ in range(4)]
    x,y,a,b = map(int, raw_input().strip().split())
    coords[i%4] += [complex(x,y)]
    for _ in range(3):
        x, y = a - (y - b), b + (x - a)
        coords[i%4] += [complex(x,y)]
    if i%4 == 3:
        for b in range(4**4):
            cb = [(b / 4**p)%4 for p in range(4)]
            verts = []
            for j in range(4):
              p = coords[j][cb[j]]
              if p in verts: continue
              verts += [p]
            if len(verts) < 4: continue
            t = [False] * 4
            for k in range(4):
                edges = [verts[j] - verts[k] for j in range(4) if j is not k]
                lensq = sorted([abs(e*e.conjugate()) for e in edges])
                if lensq[0] == 0: continue
                if lensq[0] == lensq[1] and lensq[2] == 2*lensq[0]:
                    t[k] = True
            if False not in t:
                ans[i//4] = min(ans[i//4], sum(cb))
for i in range(n):
    if ans[i] == 16: print -1
    else: print ans[i]


class Point():
    def __init__(self,x1 = 0,y1 = 0):
        self.x = x1
        self.y = y1

def dist(a,b):
    return (a.x-b.x)**2+(a.y-b.y)**2

def issquare(a,b,c,d):
    m = Point((a.x+b.x+c.x+d.x)/4,(a.y+b.y+c.y+d.y)/4)
    p = [a,b,c,d]
    if dist(p[0],m) == 0:
        return False
    for i in range(1,4):
        if dist(p[i],m) != dist(p[0],m):
            return False
    for i in range(4):
        for j in range(i+1,4):
            if dist(p[i],p[j]) == 0:
                return False
            smul = (p[i].x-m.x)*(p[j].x-m.x)+(p[i].y-m.y)*(p[j].y-m.y)
            vmul = (p[i].x-m.x)*(p[j].y-m.y)-(p[i].y-m.y)*(p[j].x-m.x)
            if (smul != 0 and vmul != 0):
                return False
    return True

n = int(raw_input())
for roop in range(n):
    p = [[Point() for i in range(4)] for j in range(4)]
    for i in range(4):
        xx,yy,a,b = map(int,raw_input().split())
        xa = xx-a
        yb = yy-b
        for j in range(4):
            p[i][j].x = (xa+a)*4
            p[i][j].y = (yb+b)*4
            xa,yb = -yb,xa
    ans = 12345
    for i in range(4):
        for j in range(4):
            for k in range(4):
                for l in range(4):
                    if (i+j+k+l < ans and issquare(p[0][i],p[1][j],p[2][k],p[3][l])):
                        ans = i+j+k+l
    print ans if ans != 12345 else -1


import copy

def dist(p1, p2):
    return ((p1[0] - p2[0]) * (p1[0] - p2[0]) +
            (p1[1] - p2[1]) * (p1[1] - p2[1]))

def check(p):
    d01 = dist(p[0], p[1])
    d02 = dist(p[0], p[2])
    d03 = dist(p[0], p[3])
    d12 = dist(p[1], p[2])
    d13 = dist(p[1], p[3])
    d23 = dist(p[2], p[3])

    if (d01 * d02 * d03 * d12 * d13 * d23) == 0:
        return False

    if d01 == d02:
        if d13 == d01 and d23 == d01 and d12 == d03:
            return True
    elif d01 == d03:
        if d12 == d01 and d23 == d01 and d13 == d02:
            return True
    elif d02 == d03:
        if d12 == d02 and d13 == d02 and d23 == d01:
            return True
    return False

def turn(p, order):
    price = 0
    for i in xrange(4):
        cur = order % 4
        order /= 4

        price += cur

        if cur == 2:
            p[i][0] = p[i][2] - (-p[i][2] + p[i][0])
            p[i][1] = p[i][3] - (-p[i][3] + p[i][1])
        elif cur == 1:
            x = p[i][0]
            y = p[i][1]
            a = p[i][2]
            b = p[i][3]
            p[i][0] = a - (y - b)
            p[i][1] = b + (x - a)
        elif cur == 3:
            x = p[i][0]
            y = p[i][1]
            a = p[i][2]
            b = p[i][3]
            p[i][0] = a + (y - b)
            p[i][1] = b - (x - a)
    if check(p):
        return price
    else:
        return -1

n = int(raw_input())

for i in xrange(n):
    p = []
    for j in xrange(4):
        s = raw_input()
        p.append([int(x) for x in s.split(' ')])

    # print p
    # turn(p, 3)
    # print p

    best_res = -1
    for j in xrange(256):
        p1 = copy.deepcopy(p)
        res = turn(p1, j)
        if res != -1 and (best_res == -1 or res < best_res):
            # print p1
            # print res
            best_res = res

    print best_res


import copy

def dist(p1, p2):
    return ((p1[0] - p2[0]) * (p1[0] - p2[0]) +
            (p1[1] - p2[1]) * (p1[1] - p2[1]))

def check(p0, p1, p2, p3):
    d01 = dist(p0, p1)
    d02 = dist(p0, p2)
    d03 = dist(p0, p3)
    d12 = dist(p1, p2)
    d13 = dist(p1, p3)
    d23 = dist(p2, p3)

    if (d01 * d02 * d03 * d12 * d13 * d23) == 0:
        return False

    if d01 == d02:
        if d13 == d01 and d23 == d01 and d12 == d03:
            return True
    elif d01 == d03:
        if d12 == d01 and d23 == d01 and d13 == d02:
            return True
    elif d02 == d03:
        if d12 == d02 and d13 == d02 and d23 == d01:
            return True
    return False

def turn(p, order):
    price = 0
    a = [1] * 4
    for i in xrange(4):
        cur = order % 4
        order /= 4
        a[i] = cur

        price += cur

    if check(p[0][a[0]],
             p[1][a[1]],
             p[2][a[2]],
             p[3][a[3]]):
        return price
    else:
        return -1

def one_turn(p, cur, a, b):
    if cur == 2:
        p[0] = a - (-a + p[0])
        p[1] = b - (-b + p[1])
    elif cur == 1:
        x = p[0]
        y = p[1]
        p[0] = a - (y - b)
        p[1] = b + (x - a)
    elif cur == 3:
        x = p[0]
        y = p[1]
        p[0] = a + (y - b)
        p[1] = b - (x - a)

n = int(raw_input())
p = [[]] * 4
for i in xrange(n):
    for j in xrange(4):
        s = raw_input()
        p[j] = ([int(x) for x in s.split(' ')])

    # print p
    # turn(p, 3)
    # print p

    p1 = [[]] * 4
    for j in xrange(4):
        p1[j] = []
        for k in xrange(4):
            p1[j].append([p[j][0], p[j][1]])

    for j in xrange(4):
        for k in xrange(4):
            one_turn(p1[j][k], k, p[j][2], p[j][3])

    best_res = -1
    for j in xrange(256):
        res = turn(p1, j)
        if res != -1 and (best_res == -1 or res < best_res):
            # print p1
            # print res
            best_res = res

    print best_res


import copy

def dist(p1, p2):
    return ((p1[0] - p2[0]) * (p1[0] - p2[0]) +
            (p1[1] - p2[1]) * (p1[1] - p2[1]))

def check(p):
    d01 = dist(p[0], p[1])
    d02 = dist(p[0], p[2])
    d03 = dist(p[0], p[3])
    d12 = dist(p[1], p[2])
    d13 = dist(p[1], p[3])
    d23 = dist(p[2], p[3])

    if (d01 * d02 * d03 * d12 * d13 * d23) == 0:
        return False

    if d01 == d02:
        if d13 == d01 and d23 == d01 and d12 == d03:
            return True
    elif d01 == d03:
        if d12 == d01 and d23 == d01 and d13 == d02:
            return True
    elif d02 == d03:
        if d12 == d02 and d13 == d02 and d23 == d01:
            return True
    return False

def turn(p, order):
    price = 0
    for i in xrange(4):
        cur = order % 4
        order /= 4

        if cur == 2:
            price += 2
        elif cur != 0:
            price += 1

        if cur == 2:
            p[i][0] = p[i][2] - (-p[i][2] + p[i][0])
            p[i][1] = p[i][3] - (-p[i][3] + p[i][1])
        elif cur == 1:
            x = p[i][0]
            y = p[i][1]
            a = p[i][2]
            b = p[i][3]
            p[i][0] = a + (y - b)
            p[i][1] = b - (x - a)
        elif cur == 3:
            x = p[i][0]
            y = p[i][1]
            a = p[i][2]
            b = p[i][3]
            p[i][0] = a - (y - b)
            p[i][1] = b + (x - a)
    if check(p):
        return price
    else:
        return -1

n = int(raw_input())

for i in xrange(n):
    p = []
    for j in xrange(4):
        s = raw_input()
        p.append([int(x) for x in s.split(' ')])

    # print p
    # turn(p, 1)
    # print p

    best_res = -1
    for j in xrange(256):
        p1 = copy.deepcopy(p)
        res = turn(p1, j)
        if res != -1 and (best_res == -1 or res < best_res):
            # print p1
            # print res
            best_res = res

    print best_res


import cmath
nooftest=input()
square=[]
for i in range(nooftest):
    square.append([])
    for j in range(4):
        square[i].append([])
        data=map(int,raw_input().split())
        a=data[0]
        b=data[1]
        x=data[2]
        y=data[3]
        rotation1=[-b+x+y,a+y-x,x,y]
        rotation2=[(2*x)-a,(2*y)-b,x,y]
        rotation3=[b+x-y,-a+y+x,x,y]
        square[i][j].append(data)
        square[i][j].append(rotation1)
        square[i][j].append(rotation2)
        square[i][j].append(rotation3)
def distance(p1,p2):
    return cmath.sqrt((p1[0]-p2[0])*(p1[0]-p2[0])+(p1[1]-p2[1])*(p1[1]-p2[1])).real
def check(array):
    p1=array[0][:2]
    p2=array[1][:2]
    p3=array[2][:2]
    p4=array[3][:2]
    d=[]
    d.append(distance(p1,p2))
    d.append(distance(p1,p3))
    d.append(distance(p1,p4))
    d.append(distance(p2,p3))
    d.append(distance(p2,p4))
    d.append(distance(p3,p4))
    d.sort()
    if d[0]==d[1] and d[1]==d[2] and d[2]==d[3] and d[3]!=d[4] and d[4]==d[5]:
        return 1
    else:
        return 0

for i in range(nooftest):
    array=[0,0,0,0]
    kanu=[]
    minimum=-1
    for j in range(4):
        array[0]=square[i][0][j]
        for k in range(4):
            array[1]=square[i][1][k]
            for l in range(4):
                array[2]=square[i][2][l]
                for m in range(4):
                    array[3]=square[i][3][m]
                    ans=check(array)
                    if(ans==1 and (minimum==-1 or minimum>j+k+l+m)):
                        minimum=j+k+l+m
                        kanu=array
    print minimum


#include<stdio.h>

#define sq(A) ((A)*(A))
int x[4][4], y[4][4], num[4], perm[4], v[4];

int min(int a, int b){return a<b?a:b;}

int perms(int d){
	int i, j, k, ret=20;
	if(d==4){
		for(i=0;i<4;++i){
			j=(i+1)&3;
			k=(j+1)&3;
			if(
					(y[perm[k]][num[perm[k]]]-y[perm[j]][num[perm[j]]])*
					(y[perm[i]][num[perm[i]]]-y[perm[j]][num[perm[j]]])
					!=
					-(x[perm[k]][num[perm[k]]]-x[perm[j]][num[perm[j]]])*
					(x[perm[i]][num[perm[i]]]-x[perm[j]][num[perm[j]]])
					) return 20;
			if(sq(x[perm[i]][num[perm[i]]]-x[perm[j]][num[perm[j]]])+
				sq(y[perm[i]][num[perm[i]]]-y[perm[j]][num[perm[j]]])!=
				sq(x[perm[j]][num[perm[j]]]-x[perm[k]][num[perm[k]]])+
				sq(y[perm[j]][num[perm[j]]]-y[perm[k]][num[perm[k]]])) return 20;
		}
		for(i=0;i<4;++i){
			for(j=0;j<4;++j){
				if(i==j) continue;
				if(x[perm[i]][num[perm[i]]]==x[perm[j]][num[perm[j]]]
					&& y[perm[i]][num[perm[i]]]==y[perm[j]][num[perm[j]]]) return 20;
			}
		}
		ret=0;
		for(i=0;i<4;++i) ret+=num[i];
		return ret;
	}
	for(i=0;i<4;++i){
		if(v[i]) continue;
		perm[d]=i;
		v[i]=1;
		ret=min(ret, perms(d+1));
		v[i]=0;
	}
	return ret;
}

int rot(int d){
	if(d==4) return perms(0);
	int ret=20;
	for(num[d]=0;num[d]<4;++num[d])
		ret=min(ret, rot(d+1));
	return ret;
}

int main(){
	int j, i, k, n, a[4], b[4], vx, vy, times[3][4]={
		{0,-1,1, 0},
		{-1,0,0,-1},
		{0, 1,-1,0}};
	scanf("%d", &n);
	for(i=0;i<n;++i){
		for(j=0;j<4;++j){
			scanf("%d %d %d %d", x[j], y[j], a+j, b+j);
			vx=x[j][0]-a[j];
			vy=y[j][0]-b[j];
			for(k=0;k<3;++k){
				x[j][k+1]=a[j]+times[k][0]*vx+times[k][1]*vy;
				y[j][k+1]=b[j]+times[k][2]*vx+times[k][3]*vy;
			}
		}
		j=rot(0);
		printf("%d\n", j<20?j:-1);
	}
	return 0;
}


//spnauti-rusT {{{
use std::io::*; use std::str::{self,*}; use std::fmt::Debug;
#[allow(unused_imports)] use std::cmp::Ordering::{self,*};
#[allow(unused_imports)] use std::ops::{self,*};
#[allow(unused_imports)] use std::iter::{self,*};
#[allow(unused_imports)] use std::collections::*;
#[allow(unused_imports)] use std::cell::*;
#[allow(unused_macros)] macro_rules! min {
	($x:expr,$y:expr) => {{ let b=$y; let a=&mut$x; if b < *a {*a=b; true} else {false} }};
}
#[allow(unused_macros)] macro_rules! max {
	($x:expr,$y:expr) => {{ let b=$y; let a=&mut$x; if b > *a {*a=b; true} else {false} }};
}
#[allow(unused_macros)] macro_rules! l {
	($($v:ident),+ =$e:expr) => {$(let$v=$e;)+};
	($($v:ident),+:$t:ty=$e:expr) => {$(let$v:$t=$e;)+};
	(mut $($v:ident),+ =$e:expr) => {$(let mut$v=$e;)+};
	(mut $($v:ident),+:$t:ty=$e:expr) => {$(let mut$v:$t=$e;)+};
}
#[allow(unused_macros)] macro_rules! v {
	([$d:expr]$($s:tt)+) => {vec![v!($($s)+);$d]};
	([]) => {Vec::new()}; ([$e:expr]) => {Vec::with_capacity($e)}; (=$e:expr) => {$e};
}
#[allow(unused_macros)] macro_rules! rep { {[$c:expr]$($s:tt)+} => {for _ in 0..$c {$($s)+}} }
#[allow(dead_code)] fn reader() -> WordReaderC { WordReaderC::new() }
#[allow(dead_code)] fn writer() -> BufWriter<Stdout> { BufWriter::new(stdout()) }
struct WordReaderC {buf: Vec<u8>, pos: usize, q: std::io::StdinLock<'static>}//'
#[allow(dead_code)] impl WordReaderC {
	fn new() -> Self {
		let r = unsafe {&*Box::into_raw(Box::new(stdin()))};
		Self { q: r.lock(), buf: v!([]), pos: 0 }
	}
	fn next_line(&mut self) -> bool {
		self.buf.clear(); self.pos = 0;
		self.q.read_until(b'\n', &mut self.buf).unwrap_or(0) > 0
	}
	fn is_ws(c: u8) -> bool {
		c == b' ' || c == b'\r' || c == b'\n' || c == b'\t'
	}
	fn byte(&mut self) -> Option<u8> {
		if self.pos == self.buf.len() { if !self.next_line() { return None; } }
		self.pos += 1; Some(self.buf[self.pos - 1])
	}
	fn vb(&mut self) -> Vec<u8> {
		let mut s = v!([8]);
		let mut f = false;
		loop {
			if let Some(c) = self.byte() {
				if !Self::is_ws(c) {
					s.push(c);
					f = true;
				} else if f { break; }
			} else { break; }
		}
		s
	}
	fn vvb(&mut self, r: usize, c: Option<usize>) -> Vec<Vec<u8>> {
		let mut res = v!([r]);
		let c = c.unwrap_or(0);
		rep!{[r]
			let t = self.vb();
			assert!(c == 0 || t.len() == c);
			res.push(t);
		}
		res
	}
	fn s(&mut self) -> String { String::from_utf8(self.vb()).expect("invalid utf8") }
	fn i(&mut self) ->    i32 { self.p() }
	fn l(&mut self) ->    i64 { self.p() }
	fn u(&mut self) ->  usize { self.p() }
	fn f(&mut self) ->    f64 { self.p() }
	fn vi(&mut self, n: usize) -> Vec<i32> { self.vp(n) }
	fn vl(&mut self, n: usize) -> Vec<i64> { self.vp(n) }
	fn vu(&mut self, n: usize) -> Vec<usize> { self.vp(n) }
	fn ii(&mut self, n: usize) -> impl Iterator<Item=i32> { self.ip(n).into_iter() }
	fn iu(&mut self, n: usize) -> impl Iterator<Item=usize> { self.ip(n).into_iter() }
	fn p<T: FromStr>(&mut self) -> T where T::Err: Debug {
		let w = self.vb(); str::from_utf8(w.as_ref()).unwrap().parse::<T>().unwrap()
	}
	fn vp<T: FromStr>(&mut self, n: usize) -> Vec<T> where T::Err: Debug {
		(0..n).map(|_|self.p()).collect()
	}
	fn ip<T: FromStr>(&mut self, n: usize) -> impl Iterator<Item=T> where T::Err: Debug {
		self.vp(n).into_iter()
	}
	fn graph(&mut self, n: usize, m: usize) -> Vec<Vec<usize>> {
		let mut e = v!([n][]); rep!{[m] l!(a,b = self.u()-1); e[a].push(b); e[b].push(a); } e
	}
	fn graph_w<T: Copy+FromStr>(&mut self, n: usize, m: usize) -> Vec<Vec<(usize,T)>> where T::Err: Debug {
		let mut e = v!([n][]); rep!{[m] l!(a,b = self.u()-1); let c: T = self.p(); e[a].push((b,c)); e[b].push((a,c)); } e
	}
}
//------------------- End rusT }}}

// 2D Geometry (integer) {{{
mod geometry {
	use std::ops::*;
	#[derive(Debug,Clone,Copy,PartialEq)] pub struct Pt2 {pub x: i64, pub y: i64}
	#[derive(Debug,Clone,Copy,PartialEq)] pub struct Vec2 {pub dx: i64, pub dy: i64}
	#[allow(dead_code)] impl Pt2 {
		pub fn new(x: i64, y: i64) -> Self { Self {x,y} }
		pub fn origin() -> Self { Self::new(0,0) }
		pub fn dist_sqr(self, o: Self) -> i64 { (self - o).len_sqr() }
		pub fn rotate_90_about(self, o: Self) -> Self { o + (self - o).rotate_90() }
	}
	#[allow(dead_code)] impl Vec2 {
		pub fn new(dx: i64, dy: i64) -> Self { Self {dx,dy} }
		pub fn dot(self, o: Self) -> i64 { self.dx*o.dx + self.dy*o.dy }
		pub fn cross(self, o: Self) -> i64 { self.dx*o.dy - self.dy*o.dx }
		pub fn rotate_90(self) -> Self { Self {dx: -self.dy, dy: self.dx} }
		pub fn len_sqr(self) -> i64 { self.dot(self) }
	}
	impl Add for Vec2 { type Output = Self; fn add(self, o: Self) -> Self::Output { Self::new(self.dx+o.dx, self.dy+o.dy) }}
	impl Add<Pt2> for Vec2 { type Output = Pt2; fn add(self, o: Pt2) -> Self::Output { o + self }}
	impl Add<Vec2> for Pt2 { type Output = Pt2; fn add(self, o: Vec2) -> Self::Output { Pt2::new(self.x+o.dx, self.y+o.dy) }}
	impl AddAssign for Vec2 { fn add_assign(&mut self, o: Self) { self.dx += o.dx; self.dy += o.dy; }}
	impl AddAssign<Vec2> for Pt2 { fn add_assign(&mut self, o: Vec2) { self.x += o.dx; self.y += o.dy; }}
	impl Neg for Vec2 { type Output = Self; fn neg(self) -> Self::Output { Self::new(-self.dx, -self.dy) }}
	impl Sub for Pt2 { type Output = Vec2; fn sub(self, o: Self) -> Self::Output { Vec2::new(self.x-o.x, self.y-o.y) }}
	impl Sub for Vec2 { type Output = Self; fn sub(self, o: Self) -> Self::Output { self + -o }}
	impl Sub<Vec2> for Pt2 { type Output = Pt2; fn sub(self, o: Vec2) -> Self::Output { self + -o }}
	impl From<Pt2> for Vec2 { fn from(p: Pt2) -> Vec2 { Vec2 {dx: p.x, dy: p.y} }}
	impl From<Vec2> for Pt2 { fn from(v: Vec2) -> Pt2 { Pt2 {x: v.dx, y: v.dy} }}
}//}}}

fn main() {
	let mut rin = reader();
	let mut rout = writer();

	use geometry::Pt2;
	rep!{[rin.u()]
		l!(mut p,h = v!([4]));
		rep!{[4]
			l!(a,b,c,d = rin.l());
			p.push( Pt2::new(a,b) );
			h.push( Pt2::new(c,d) );
		}
		let mut sol = 100;
		for b in 0..1<<8 {
			let mut res = 0;
			let mut pp = p.clone();
			for i in 0..4 {
				let c = (b >> (2*i)) & 3;
				res += c;
				rep!{[c]
					pp[i] = pp[i].rotate_90_about(h[i]);
				}
			}
			let mut d = v!([6]);
			for i in 0..4 {
				for j in i+1..4 {
					d.push( (pp[i] - pp[j]).len_sqr() );
				}
			}
			d.sort();
			if d[0] == d[3] && d[4] == d[5] && d[0] > 0 {
				min!(sol, res);
			}
		}
		if sol == 100 {
			writeln!(rout, "-1").ok();
		} else {
			writeln!(rout, "{}", sol).ok();
		}
	}
}


import math, operator

pos = []

for a in range(4):
    for b in range(4):
        for c in range(4):
            for d in range(4):
                pos.append([int(k) for k in list("{0}{1}{2}{3}".format(a, b, c, d))] + [sum([a, b, c, d])])

pos.sort(key=lambda ori: ori[4])

T = int(raw_input())

locs = []

def fop(x, y, p, q):
    x -= p
    y -= q
    ret = [[x, y]]
    for i in range(1, 4):
        ret.append([-1*ret[i-1][1], ret[i-1][0]])
    for i in range(4):
        ret[i][0] += p
        ret[i][1] += q
    return ret

def dist(W, V):
    return math.sqrt((W[0] - V[0])**2 + (W[1] - V[1])**2)
'''
def isSquare(A1, B1, C1, D1):
    A, B, C, D = tuple(sorted([A1, B1, C1, D1], key=operator.itemgetter(0)))
    bad = (A==B, A==C, A==D, B==C, B==D, C==D)
    if any(bad):
        return False
    dists = set()
    dists.add(dist(A, B))
    dists.add(dist(A, C))
    dists.add(dist(A, D))
    if len(dists) != 2:
        return False
    dists = sorted(list(dists))
    return abs((dists[1]/math.sqrt(2)) - dists[0]) < 0.0000001
'''

def isSquare(A, B, C, D):
    bad = (A==B, A==C, A==D, B==C, B==D, C==D)
    if any(bad):
        return False
    dists = set()
    dists.add(dist(A, B))
    dists.add(dist(A, C))
    dists.add(dist(A, D))
    dists.add(dist(B, C))
    dists.add(dist(B, D))
    dists.add(dist(C, D))
    if len(dists) != 2:
        return False
    dists = sorted(list(dists))
    return abs((dists[1]/math.sqrt(2)) - dists[0]) < 0.0000001

for t in range(T):
    a, b, c, d = (tuple((int(k) for k in raw_input().split())) for j in range(4))
    apos, bpos, cpos, dpos = fop(*a), fop(*b), fop(*c), fop(*d)
    for m in pos:
        if isSquare(apos[m[0]], bpos[m[1]], cpos[m[2]], dpos[m[3]]):
            print m[4]
            break
    else:
        print -1


import math

pos = []

for a in range(4):
    for b in range(4):
        for c in range(4):
            for d in range(4):
                pos.append([int(k) for k in list("{0}{1}{2}{3}".format(a, b, c, d))] + [sum([a, b, c, d])])

pos.sort(key=lambda ori: ori[4])

T = int(inp.readline())

locs = []

def fop(x, y, p, q):
    x -= p
    y -= q
    ret = [[x, y]]
    for i in range(1, 4):
        ret.append([-1*ret[i-1][1], ret[i-1][0]])
    for i in range(4):
        ret[i][0] += p
        ret[i][1] += q
    return ret

def dist(W, V):
    return math.sqrt((W[0] - V[0])**2 + (W[1] - V[1])**2)

def isSquare(A, B, C, D):
    bad = (A==B, A==C, A==D, B==C, B==D, C==D)
    if any(bad):
        return False
    dists = set()
    dists.add(dist(A, B))
    dists.add(dist(A, C))
    dists.add(dist(A, D))
    if len(dists) != 2:
        return False
    dists = sorted(list(dists))
    return abs((dists[1]/math.sqrt(2)) - dists[0]) < 0.0000001

for t in range(T):
    a, b, c, d = (tuple((int(k) for k in raw_input().split())) for j in range(4))
    apos, bpos, cpos, dpos = fop(*a), fop(*b), fop(*c), fop(*d)
    for m in pos:
        if isSquare(apos[m[0]], bpos[m[1]], cpos[m[2]], dpos[m[3]]):
            print m[4]
            break
    else:
        print -1


import math

pos = []

for a in range(4):
    for b in range(4):
        for c in range(4):
            for d in range(4):
                pos.append([int(k) for k in list("{0}{1}{2}{3}".format(a, b, c, d))] + [sum([a, b, c, d])])

pos.sort(key=lambda ori: ori[4])

T = int(raw_input())

locs = []

def fop(x, y, p, q):
    x -= p
    y -= q
    ret = [[x, y]]
    for i in range(1, 4):
        ret.append([-1*ret[i-1][1], ret[i-1][0]])
    for i in range(4):
        ret[i][0] += p
        ret[i][1] += q
    return ret

def dist(W, V):
    return math.sqrt((W[0] - V[0])**2 + (W[1] - V[1])**2)

def isSquare(A, B, C, D):
    bad = (A==B, A==C, A==D, B==C, B==D, C==D)
    if any(bad):
        return False
    dists = set()
    dists.add(dist(A, B))
    dists.add(dist(A, C))
    dists.add(dist(A, D))
    if len(dists) != 2:
        return False
    dists = sorted(list(dists))
    return abs((dists[1]/math.sqrt(2)) - dists[0]) < 0.0000001

for t in range(T):
    a, b, c, d = (tuple((int(k) for k in raw_input().split())) for j in range(4))
    apos, bpos, cpos, dpos = fop(*a), fop(*b), fop(*c), fop(*d)
    for m in pos:
        if isSquare(apos[m[0]], bpos[m[1]], cpos[m[2]], dpos[m[3]]):
            print m[4]
            break
    else:
        print -1


import math

inp = open("captain.in", "r")

raw_input = inp.readline

pos = []

for a in range(4):
    for b in range(4):
        for c in range(4):
            for d in range(4):
                pos.append([int(k) for k in list("{0}{1}{2}{3}".format(a, b, c, d))] + [sum([a, b, c, d])])

pos.sort(key=lambda ori: ori[4])

T = int(inp.readline())

locs = []

def fop(x, y, p, q):
    x -= p
    y -= q
    ret = [[x, y]]
    for i in range(1, 4):
        ret.append([-1*ret[i-1][1], ret[i-1][0]])
    for i in range(4):
        ret[i][0] += p
        ret[i][1] += q
    return ret

def dist(W, V):
    return math.sqrt((W[0] - V[0])**2 + (W[1] - V[1])**2)

def isSquare(A, B, C, D):
    dists = set()
    dists.add(dist(A, B))
    dists.add(dist(A, C))
    dists.add(dist(A, D))
    if len(dists) != 2:
        return False
    dists = sorted(list(dists))
    return abs((dists[1]/math.sqrt(2)) - dists[0]) < 0.0000001

for t in range(T):
    a, b, c, d = (tuple((int(k) for k in raw_input().split())) for j in range(4))
    apos, bpos, cpos, dpos = fop(*a), fop(*b), fop(*c), fop(*d)
    for m in pos:
        if isSquare(apos[m[0]], bpos[m[1]], cpos[m[2]], dpos[m[3]]):
            print m[4]
            break
    else:
        print -1