#include <cstdio>
#include <iostream>
#include <algorithm>
using namespace std;
using ll = long long;

int main(){
	int tc; cin >> tc;
	for(ll a, b, c, d; tc--; ){
		cin >> a >> b >> c >> d;
		
		if(a < b || b > d){ puts("No"); continue; }
		if(b <= c+1){ puts("Yes"); continue; }
		
		ll p = a % b, q = c % b;
		ll bb;
		if(p > q) bb = c + (p-q);
		else bb = c + (p+b-q);
		
		if(bb < b){ puts("No"); continue; }
		ll r = d % b;
		if(r == 0){ puts("Yes"); continue; }
		else if(__gcd(r, b) == 1){ puts("No"); continue; }
		else{
			ll s = c % b;
			ll u = bb % b;
			if(s == u){
				if(c + r < b){ puts("No"); continue; }
				else{ puts("Yes"); continue; }
			}
			else if(s < u){
				ll diff = u - s;
				diff %= r;
				if(diff == 0) diff += r;
				if(c + diff < b){ puts("No"); continue; }
				else{ puts("Yes"); continue; }
			}
			else{
				u %= r; u += b;
				ll diff = u - s;
				diff %= r;
				if(diff == 0) diff += r;
				if(c + diff < b){ puts("No"); continue; }
				else{ puts("Yes"); continue; }
			}
		}
	}
	return 0;
}
