using System;
using System.Collections.Generic;
using System.Linq;
using static System.Console;

class Program
{
    static void Main()
    {
        var T = int.Parse(ReadLine());
        for (int i = 0; i < T; i++)
        {
            var ABCD = ReadLine().Split().Select(long.Parse).ToArray();
            var A = ABCD[0];
            var B = ABCD[1];
            var C = ABCD[2];
            var D = ABCD[3];

            if (A < B || D < B)
            {
                WriteLine("No");
                continue;
            }
            var b = true;
            var c = A - Math.Max(A - C,0) / B * B;
            for (int j = 0; j < 100000; j++)
            {
                if (c <= C) c += D;
                c = c - Math.Max(A - C,0) / B * B;
                if (c < 0)
                {
                    WriteLine("No");
                    b=false;
                   break;
                }
            }
            if(b)WriteLine("Yes");
        }
    }
}