import std.stdio;
import std.string;
import std.conv;
import std.algorithm;
import std.container;

void main() {
    int T = readln.chomp.to!(int);
    
    for (int i = 0; i < T; i++) {
        ulong[] buf = readln.chomp.split.to!(ulong[]);
        ulong a = buf[0], b = buf[1], c = buf[2], d = buf[3];

        if (a < b) {
            writeln("No");
        } else if (b > d) {
            writeln("No");
        } else {
            bool flg = true;
            bool[ulong] hoge;
            ulong s = a % b;
            while (true) {
                if (hoge.get(s, false)) { // 1度trueと判定したところに来たらその後もtrue
                    writeln("Yes");
                    break;
                } else {
                    if (s > c) {
                        if (s < b) {
                            writeln("No");
                            break;
                        } else {
                            hoge[s] = true;
                            s -= b;
                        }
                    } else {
                        if (s + d < b) {
                            writeln("No");
                            break;
                        }
                        hoge[s] = true;
                        s = (s + d) % b;
                    }
                }
            }
        }
    }

    return;
}
