using System;
using System.Diagnostics;
using PriorityQueue;
class P
{
    static PriorityQueue<long> Checked = new PriorityQueue<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]);
            Solv(a, b, c, d);
            Checked = new PriorityQueue<long>();
        }
    }
    static void Solv(long a, long b, long c, long d)
    {
        if (a < b)
        {
            Debug.WriteLine("No");
            Console.WriteLine("No");
            return;
        }
        if (c >= b && d >= b)
        {
            Debug.WriteLine("Yes");
            Console.WriteLine("Yes");
            return;
        }
        long apn = a - b;
        if ((c < apn && apn < b) || (apn < b - d))
        {
            Debug.WriteLine("No");
            Console.WriteLine("No");
            return;
        }
        if (Checked.Contains(a))
        {
            Debug.WriteLine("Yes");
            Console.WriteLine("Yes");
            return;
        }
        Checked.Enqueue(a);
        a -= b;
        if (a > c)
        {
            a %= b;
            long n = c / b;
            a += n * b;
            if (a > c && a >= b)
                a -= b;
        }
        if (a <= c)
            a += d;
        Solv(a, b, c, d);
    }
}
namespace PriorityQueue //優先度付きキュー
{
    using System;
    using System.Collections.Generic;
    class PriorityQueue<T>
    {
        private readonly List<T> heap;
        private readonly Comparison<T> compare;
        private int size;
        public PriorityQueue() : this(Comparer<T>.Default) { }
        public PriorityQueue(IComparer<T> comparer) : this(16, comparer.Compare) { }
        public PriorityQueue(Comparison<T> comparison) : this(16, comparison) { }
        public PriorityQueue(int capacity, Comparison<T> comparison)
        {
            this.heap = new List<T>(capacity);
            this.compare = comparison;
        }
        public void Enqueue(T item)
        {
            this.heap.Add(item);
            var i = size++;
            while (i > 0)
            {
                var p = (i - 1) >> 1;
                if (compare(this.heap[p], item) <= 0)
                    break;
                this.heap[i] = heap[p];
                i = p;
            }
            this.heap[i] = item;

        }
        public T Dequeue()
        {
            var ret = this.heap[0];
            var x = this.heap[--size];
            var i = 0;
            while ((i << 1) + 1 < size)
            {
                var a = (i << 1) + 1;
                var b = (i << 1) + 2;
                if (b < size && compare(heap[b], heap[a]) < 0) a = b;
                if (compare(heap[a], x) >= 0)
                    break;
                heap[i] = heap[a];
                i = a;
            }
            heap[i] = x;
            heap.RemoveAt(size);
            return ret;
        }
        private bool binary_search(T x, int imin, int imax)
        {
            if (imax < imin)
                return false;
            int imid = imin + (imax - imin) / 2;
            if (compare(heap[imid], x) > 0)
                return binary_search(x, imin, imid - 1);
            else if (compare(heap[imid], x) < 0)
                return binary_search(x, imid + 1, imax);
            return true;
        }
        public bool Contains(T x)
        {
            return binary_search(x, 0, heap.Count - 1);
        }
        public T Peek() { return heap[0]; }
        public int Count { get { return size; } }
        public bool Any() { return size > 0; }
    }
}