#include <bits/stdc++.h>
using namespace std;
typedef long long LL;

int main(){
	LL T;
	cin >> T;
	for(int t = 0; t < T; t++){
		LL A, B, C, D;
		cin >> A >> B >> C >> D;
		if(A < B || D < B){
			cout << "No" << '\n';			
			continue;
		}
		LL r = __gcd(B,D);
		LL mult = (C + 1 - (A % r) + r - 1) / r;
		LL F = mult * r + (A % r);
		if(F >= B){
			cout << "Yes" << '\n';
		} else {
			cout << "No" << '\n';			
		}
	}
}
