#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <iostream>
#include <algorithm>
using namespace std;
typedef long long ll;
int n;
ll a, b, c, d;

ll gcd(ll x, ll y) {
	if(x % y == 0) return y;
	else return gcd(y, x % y);
}

bool chk(int A, int B, int C, int D) {
	if(D < B || A < B) return 0;
	if(C >= B  -1) return 1;
	ll tmp = gcd(B, D);
	A %= tmp;
	return B - tmp + A <= C;
}

int main() {
	cin >> n;
	while(n--) {
		cin >> a >> b >> c >> d;
		if(chk()) cout << "Yes" << endl;
		else cout << "No" << endl;
	}
}