using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AtCoder
{
    class Program
    {
        static public bool Query(long a,long b,long c,long d,List<long> memo)
        {
            a = a - b;

            if (a <= c)
            {
                a = a + d;
            }

            if (memo.Any(m => m == a))
            {
                return true;
            }
            else if (a<b)
            {
                return false;
            }else
            {
                memo.Add(a);
                return Query(a % b +b, b, c, d, memo);
            }
        }

        static void Main()
        {
            IO io = new IO();

            //ここから

            int t = io.ReadLineToInt();
            long[] a = new long[t];
            long[] b = new long[t];
            long[] c = new long[t];
            long[] d = new long[t];

            for (int i = 0; i < t; i++)
            {
                long[] str = Console.ReadLine().Split(' ').Select(long.Parse).ToArray();
                a[i] = str[0];
                b[i] = str[1];
                c[i] = str[2];
                d[i] = str[3];
            }

            for(int i = 0; i < t; i++)
            {
                List<long> memo = new List<long>();
                memo.Add(a[i]);
                if (b[i]>a[i] || b[i]>d[i])
                {
                    Console.WriteLine("No");
                }
                else if (c[i] > b[i] && d[i] > b[i])
                {
                    Console.WriteLine("Yes");
                }
                else if (Query(a[i]%b[i]+b[i], b[i], c[i], d[i], memo))
                {
                    Console.WriteLine("Yes");
                }
                else
                {
                    Console.WriteLine("No");
                }
            }

            //ここまで
            //Console.Write();
            Console.ReadKey();
        }
    }

    //関数
    public class Func
    {
        public void Swap<T>(ref T a,ref T b)
        {
            T temp;
            temp = a;
            a = b;
            b = temp;
        }
    }

    //IOを担う関数群
    public class IO
    {
        //stringの入力
        public string ReadLineToString()
        {
            return Console.ReadLine();
        }

        //intの入力
        public int ReadLineToInt()
        {
            return int.Parse(Console.ReadLine());
        }

        //空白区切りの複数の文字列の入力をstring[]にして返す
        public string[] ReadLineToStringArray()
        {
            return Console.ReadLine().Split(' ').ToArray();
        }


        //空白区切りの複数の整数の入力をint[]にして返す
        public int[] ReadLineToIntArray()
        {
            return Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
        }

        //空白区切りの複数の文字列の入力をList<string>で受け取る
        public List<string> ReadLineToStringList()
        {
            return Console.ReadLine().Split(' ').ToList();
        }

        //空白区切りの複数の整数の入力をList<int>で受け取る
        public List<int> ReadLineToIntList()
        {
            return Console.ReadLine().Split(' ').Select(int.Parse).ToList();
        }
    }

}
