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;
        }
        a = a % b + b;
        d = d % b + b;
        string ans = "Yes";
        long e = a;

         while(1) {
            e -= b;
            if (e < 0) {
                ans = "No";
                break;
            }
            if (e <= c) {
                e += d;
            }

            if (e == a) {
                ans = "Yes";
                break;
            }
        }
        writeln(ans);
    }
}