import std.stdio, std.algorithm, std.conv, std.array, std.string, std.math;

void main()
{
    auto T = readln.chomp.to!int;
    foreach (_t; 0..T) {
        auto abcd = readln.split.to!(long[]);
        auto A = abcd[0];
        auto B = abcd[1];
        auto C = abcd[2];
        auto D = abcd[3];

        A -= B;
        foreach (_n; 0..1000) {
            if (A < 0) break;
            A %= B;
            if (A > C) A -= B;
            if (A < 0) break;
            A = A + D - B;
        }
        writeln(A < 0 ? "No" : "Yes");
    }
}