import std.stdio;
import std.conv;
import std.string;

void main()
{
    int t;
    long 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";
        long e = a;
        auto p = new int[a.to!uint * 10];
        p[] = 0;
        while(1)
        {
            e -= b;
            if (e < 0)
            {
                ans = "No";
                break;
            }

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

            if (e >= b)
                p[e.to!uint]++;

            if (p[e.to!uint] > 1)
            {
                ans = "Yes";
                break;
            }
        }
        writeln(ans);
    }
}