/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author yassin
 */

#include <bits/stdc++.h>

using namespace std;

class agc026_b {
public:
    void solve(istream& in, ostream& out) {
        int T;
        in >> T;
        for (int t = 1; t <= T; ++t) {
            long long A, B, C, D;
            in >> A >> B >> C >> D;
            if (A < B || B > D) {
                out << "No\n";
                continue;
            }
            if (A % B > C) {
                out << "No\n";
                continue;
            }
            A %= B;
            A += (A <= C) * D;
            set<long long> vis;
            for (int i = 0; i < 10'000; ++i) {
                if (A < B) {
                    out << "No\n";
                    goto end;
                }
                vis.insert(A);
                A -= B;
                A += (A <= C) * D;
                if (vis.count(A)) {
                    break;
                }
            }
            out << "Yes\n";
            end:;
        }
    }
};

int main() {
	std::ios::sync_with_stdio(false); cin.tie(nullptr);
	agc026_b solver;
	std::istream& in(std::cin);
	std::ostream& out(std::cout);
	solver.solve(in, out);
	return 0;
}
