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

class Program
{
    public static void Main()
    {
        int T = int.Parse(ReadLine());
        ulong[] a = new ulong[T];
        ulong[] b = new ulong[T];
        ulong[] c = new ulong[T];
        ulong[] d = new ulong[T];
        foreach (int i in EnumerableCommon.Range(T))
        {
            var input = ReadLine().Split();
            a[i] = ulong.Parse(input[0]);
            b[i] = ulong.Parse(input[1]);
            c[i] = ulong.Parse(input[2]);
            d[i] = ulong.Parse(input[3]);
        }
        ulong stock = 0;
        foreach (int i in EnumerableCommon.Range(T))
        {
            bool ok = true;
            if (b[i] <= a[i] && b[i] <= d[i] && (a[i] % b[i] <= c[i]))
            {
                stock = a[i] % b[i];
                int sameCount = 0;
                while (true)
                {
                    if (sameCount == 3)
                    {
                        ok = true;
                        break;
                    }
                    ulong temp = stock;

                    //昼
                    if (stock > c[i])
                    {
                        ok = false;
                        break;
                    }
                    else if (stock == 0)
                    {
                        ok = true;
                        break;
                    }
                    //夜
                    if (stock <= c[i]) { stock = (stock + d[i]) % b[i]; }
                    if (stock == temp) sameCount++;
                    else sameCount = 0;
                }
            }
            else ok = false;
            if (ok) WriteLine("Yes");
            else WriteLine("No");
        }
    }

    public static partial class EnumerableCommon
    {
        public static IEnumerable<int> Range(int count)
        {
            return Enumerable.Range(0, count);
        }
    }
}