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

void solve()
{
    auto abcd = readln.split.to!(long[]);
    auto A = abcd[0];
    auto B = abcd[1];
    auto C = abcd[2];
    auto D = abcd[3];

    A -= B;
    long[] as = [A];
    foreach (_; 0..1000) {
        if (A < 0) break;
        A %= B;
        if (A > C) {
            A -= B;
            break;
        }
        as ~= A;
        A = A + D - B;
    }

    if (A < 0) {
        writeln("No");
        return;
    }

    long last = -1, cur;
    foreach_reverse (a; as) {
        if (a == last) {
            writeln("Yes");
            return;
        } else if (a > last) {
            last = a;
        } else {
            cur = a;
            break;
        }
    }
    auto d = last - cur;
    auto m = (C - cur) % d;
    if (!m) {
        writeln("Yes");
        return;
    } else if (C + d - m < B) {
        writeln("No");
        return;
    }
    writeln("Yes");
    return;
}

void main()
{
    auto T = readln.chomp.to!int;
    foreach (_; 0..T) solve();
}