using System;
using System.Collections.Generic;
//using System.Linq;
//using System.Text;
class P
{
    static List<long> Checked = new List<long>();
    static void Main()
    {
        int t = int.Parse(Console.ReadLine());
        for (int i = 0; i < t; i++)
        {
            long a, b, c, d;
            string[] s = Console.ReadLine().Split();
            a = long.Parse(s[0]);
            b = long.Parse(s[1]);
            c = long.Parse(s[2]);
            d = long.Parse(s[3]);
            //Console.WriteLine(String.Format("{0} {1} {2} {3}", a, b, c, d));
            Solv(a, b, c, d);
            Checked = new List<long>();
        }
    }
    static void Solv(long a, long b, long c, long d)
    {
        if (a < b)
        {
            Console.WriteLine("No");
            return;
        }
        if (c >= b && d >= b)
        {
            Console.WriteLine("Yes");
            return;
        }
        long apn = a - b;
        if ((c < apn && apn < b) || (apn < b - d))
        {
            Console.WriteLine("No");
            return;
        }
        if (Checked.Contains(a))
        {
            Console.WriteLine("Yes");
            return;
        }
        Checked.Add(a);
        //Console.WriteLine(a);
        if (a > c)
        {
            a %= b;
            long n = c / b;
            a += n * b;
        }
        if (a <= c)
            a += d;
        //Console.WriteLine(a);
        Solv(a, b, c, d);
    }
}