using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace test
{
    class Program
    {
        static void Main(string[] args)
        {
            var T = int.Parse(Console.ReadLine());

            for (var i = 0; i < T; i++)
            {
                var input = Console.ReadLine().Split(' ').Select(s => long.Parse(s)).ToArray();
                long A = input[0], B = input[1], C = input[2], D = input[3];

                if (A < B)
                {
                    Console.WriteLine("No");
                    continue;
                }
                else if (B > D)
                {
                    Console.WriteLine("No");
                    continue;
                }

                var L = new List<long>();

                if (A - B > B)
                {
                    A -= (A - B) / B * B;
                }
                if (D - B > B)
                {
                    D -= (D - B) / B * B;
                }

                do
                {                    
                    A -= B;
                    if (L.Contains(A))
                    {
                        Console.WriteLine("Yes");
                        break;
                    }
                    L.Add(A);
                    if (A > C && A < B)
                    {
                        Console.WriteLine("No");
                        break;
                    }
                    if (A < C)
                    {
                        A += D;
                    }                    
                } while (true);
            }
        }
    }
}