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

namespace P_AtCoder
{
    class Program
    {
        static void Main(string[] args)
        {
            var judgeCount = int.Parse(Console.ReadLine());
            for (int loopCount = 0; loopCount < judgeCount; loopCount++)
            {
                var param = Console.ReadLine().Split(' ').Select(x => long.Parse(x)).ToArray();
                Console.WriteLine(IsValid(param[0], param[1], param[2], param[3]) ? "Yes" : "No");
            }
        }

        static bool IsValid(long start, long buy, long threshold, long addTo)
        {
            if (start < buy)
            {
                return false;
            }
            else if (buy > addTo)
            {
                return false;
            }
            else if (buy <= (threshold + 1))
            {
                return true;
            }
            else if ((threshold + addTo) == start)
            {
                return true;
            }
            else
            {
                return (buy % threshold == 0 && (start - buy) <= threshold);
            }
        }
    }
}
