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

public class Program{
    public static void Main(){
        var N = long.Parse(ReadLine());
        for(int i=0;i<N;i++){
            var line = ReadLine().Split(' ').Select(x=>long.Parse(x)).ToArray();
            WriteLine(Judge(line));
        }
    }
    static string Judge(long[] array){
        var A = array[0];
        var B = array[1];
        var C = array[2];
        var D = array[3];
        if(B>A||B>D) return "No";
        var p = D%B;
        //for(long i=0;i<B;i++) table[i] = false;
        long tmp = A%B;
        //table[tmp] = true;
        for(long i=0;i<B;i++){
            tmp = (tmp+p)%B;
            if(tmp>C) return "No";
        }
        return "Yes";
    }
}
//var N = long.Parse(ReadLine());