#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <fstream>
#include <cassert>
#include <cstring>
#include <unordered_set>
#include <unordered_map>
#include <numeric>
#include <ctime>
#include <bitset>
#include <complex>
#include <chrono>
#include <random>
#include <functional>

using namespace std;

#define int long long

void solve() {
	int a, b, c, d;
	cin >> a >> b >> c >> d;
	if (d < b) {
		cout << "No\n";
		return;
	}
	if (a < b) {
		cout << "No\n";
		return;
	}
	d %= b;
	if (c >= b) {
		cout << "Yes\n";
		return;
	}
	a %= b;
	int g = gcd(d, b);
	int p = b - 1;
	while ((p % g) != (a % g)) {
		p--;
	}
	if (abs(b - p) < b - c) {
		cout << "No\n";
		return;
	}
	cout << "Yes\n";
}

signed main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0);	
	
	int q;
	cin >> q;
	while (q--) {
		solve();
	}	
}
