import std.stdio;
import std.conv;
import std.string;
import std.algorithm.iteration;

void main()
{
    int t;
    ulong a, b, c, d;

    readf(" %s", &t);
    foreach (i; 0..t) {
        readf(" %s %s %s %s", &a, &b, &c, &d);
        if (a < b) {
            writeln("No");
            continue;
        }
        if (a > b)
            a = a % b + b;
        if (d > b)
            d = d % b + b;
        string ans = "Yes";
        ulong e = a;
        ulong[] p;
        while(1) {
            if (e < b) {
                ans = "No";
                break;
            }
            e -= b;

            if (e <= c)
                e += d;

            if (e >= b)
                p ~= e;

            ulong count = 0;
            foreach (j; p)
                if (j == e)
                    count++;
            if (count > 1) {
                ans = "Yes";
                break;
            }
        }
        writeln(ans);
    }
}