using System;
using System.Linq;

namespace AGC026_B
{
    class Program
    {
        static void Main(string[] args)
        {
            var T = int.Parse(Console.ReadLine());
            for (int i = 0; i < T; i++)
            {
                var input = Console.ReadLine().Split().Select(long.Parse).ToArray();
                long A = input[0];
                long B = input[1];
                long C = input[2];
                long D = input[3];
                bool p = true;

                if (A < B || B > D)
                {
                    p = false;
                    Console.WriteLine(p ? "Yes" : "No");
                    continue;
                }

                A = A % B + B;
                D = D % B + B;

                if (B == D)
                {
                    if (A - B > C)
                    {
                        p = false;
                    }
                }
                else if (B - C == 1)
                {
                }
                else if (B - C == 2 && B % 2 == 0 && D % 2 == 0)
                {
                }
                else if (B - C >= SamePrime(B,D) + 1)
                {
                    p = false;
                }

                Console.WriteLine(p ? "Yes" : "No");
            }
        }

        private static int SamePrime(long n1, long n2)
        {
            for (int i = 1; i < Math.Min(n1, n2); i++)
                if (n1 % i == n2 % i)
                {
                    return i;
                }
            return 0;
        }
    }
}
