using System;
using System.Linq;
class Program
{
    static void Main(string[] args)
    {
        int cnt = 0;
        ulong wk,a, b, c, d;
        string ans = "No";
        int inputNum = int.Parse(Console.ReadLine());
        string[] ansArray = new string[inputNum];
        for (int i = 0; i < inputNum; i++)
        {
            var inputQ = Console.ReadLine().Split().Select(ulong.Parse).ToArray();
            a = inputQ[0];
            b = inputQ[1];
            c = inputQ[2];
            d = inputQ[3];

            wk = a;
            while (a >= b)
            {
                a -= b;
                if (a <= c) { a += d; }
                if (a == wk) { cnt++; }
                if (cnt == 2) { ans = "Yes"; cnt =0 ; break; }
            }
            ansArray[i] = ans;
        }

        foreach(string answer in ansArray)
        {
            Console.WriteLine(answer);
        }
    }
}
