//
//  main.cpp
//
 
#include <algorithm>
#include <array>
#include <assert.h>
#include <functional>
#include <iostream>
#include <iomanip>
#include <limits>
#include <map>
#include <math.h>
#include <memory>
#include <queue>
#include <random>
#include <set>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <vector>
 
using namespace std;
 
using ll = long long;
using ull = unsigned long long;
 
template<typename T>
vector<T> make_vec_nd(T init, size_t size) {
	return vector<T>(size, init);
}
template<typename T, typename... Args>
auto make_vec_nd(T init, size_t size, Args... rest) {
	auto inner = make_vec_nd(init, rest...);
	return vector<decltype(inner)>(size, inner);
}

#define rep(i,a,b) for(ll i=(a);i<(b);i++)
#define rrep(i,a,b) for(ll i=(a)-1;i>=(b);i--)

int main() {
	ll Y;
	cin >> Y;
	rep(y,0,Y) {
		ll A, B, C, D;
		cin >> A >> B >> C >> D;
		if (A < B) {
			cout << "No" << endl;
			continue;
		}
		if (A%B > C) {
			cout << "No" << endl;
			continue;
		}
		if (D < B) {
			cout << "No" << endl;
			continue;
		}
		if (D == B) {
			cout << "Yes" << endl;
			continue;
		}
		ll E = D - B;
		ll bad_end;
		if (B <= C + 1) {
			bad_end = 1;
		} else if (B >= C + E + 1) {
			bad_end = E + 1;
		} else {
			bad_end = B - C;
		}
		ll J = gcd(B, E);
		ll X = ((A - C) % E + E) % E;
		if (X == 0) {
			X = E;
		}
		X = X % J;
		if (X == 0) {
			X += J;
		}
		if (X < bad_end) {
			cout << "No" << endl;
		} else {
			cout << "Yes" << endl;
		}
		continue;
	}
}
