import std.stdio, std.string, std.conv;
import std.range, std.algorithm, std.array, std.typecons, std.container;
import std.math, std.numeric, core.bitop;

/*
A = 1, B = 2, C = 100, D = 100みたいなケースもある
*/

void main() {
    int t;
    scan(t);

    while (t--) {
        long ai, bi, ci, di;
        scan(ai, bi, ci, di);
        writeln(solve(ai, bi, ci, di));
    }
}

string solve(long a, long b, long c, long d) {
    if (a < b) {
        return "No";
    }

    if (b > c) {
        if (b == c + 1) {
            if (d >= b) {
                return "Yes";
            }
            else {
                return "No";
            }
        }
        if ((a % b) > c) {
            return "No";
        }
        else {
            long g = gcd(b, d);
            if (d >= b && (c + 1 + g - 1) / g * g >= b) {
                return "Yes";
            }
            else {
                return "No";
            }
        }
    }
    else {
        if (b == 1) {
            return "Yes";
        }
        if (d >= c) {
            return "Yes";
        }
        else {
            if (b <= d) {
                return "Yes";
            }
            else {
                return "No";
            }
        }
    }
}









































void scan(T...)(ref T args) {
    import std.stdio : readln;
    import std.algorithm : splitter;
    import std.conv : to;
    import std.range.primitives;

    auto line = readln().splitter();
    foreach (ref arg; args) {
        arg = line.front.to!(typeof(arg));
        line.popFront();
    }
    assert(line.empty);
}



void fillAll(R, T)(ref R arr, T value) {
    static if (is(typeof(arr[] = value))) {
        arr[] = value;
    }
    else {
        foreach (ref e; arr) {
            fillAll(e, value);
        }
    }
}
