#include <bits/stdc++.h>
using namespace std;
#define e1 first
#define e2 second
#define pb push_back
#define mp make_pair
#define boost ios_base::sync_with_stdio(false)
#define eb emplace_back
#define OUT(x) {cout << x; exit(0); }
#define REYNA(i,a,b) for(int i=(a);i<(b);++i)
#define FOR(i,a,b) for(int i=(a);i<=(b);++i)
#define scanf(...) scanf(__VA_ARGS__)?:0
typedef long long int ll;
typedef unsigned long long ull;
typedef pair <int, int> PII;
typedef pair <ll, ll> PLL;
typedef pair <PLL, int> PLLI;
typedef pair <PLL, pair <int, ll> > PP;
typedef pair <PII, int> PPI;
typedef pair <int, PII> PIP;
typedef pair <ll, int> PLI;
typedef unsigned int ui;
const int mod = 1e9+7;
const int inf = 1e9+9;
const ll MOD = 1e9+696969;
const long long INF = 1e18+3;
int t;

bool fails(ll pos, ll c)
{
	if (pos > c) return 1;
	return 0;
}

bool solve()
{
	ll a, b, c, d;
	cin >> a >> b >> c >> d;
	if (b > d) return 0;
	if (b > a) return 0;
	if (b <= c) return 1; //na pewno sie da
	if (fails(a % b, c)) return 0;
	if (d % b == 0) return 1; //teraz sie da
	ll p = __gcd(b, d);
	
	ll reszta = (a % p);
	if (reszta == 0) reszta = p;
	if (fails((b - reszta) % b, c)) return 0;
	return 1;
}

int main()
{
	boost;
	cin >> t;
	while (t--)
	{
		if (solve()) cout << "Yes\n";
		else cout << "No\n";
	}
}
