#include <bits/stdc++.h>
using namespace std; 
#define endl '\n' 

using namespace std; 

int main()
{
	int t; 
	cin >> t ; 
	while(t--){
		long long a,b,c,d; 
		cin >> a >> b >> c >> d; 
		if(a < b || d < b) cout << "No";
		else if(c >= b - 1) cout << "Yes"; 
		else{
			double m = ceil ((double) (b - (a%b)) / __gcd(b,d)) - 1;
			int n = (int) m; 
			n = (a + (n  * __gcd(b,d))) % b; 
			// cout << "The maximum modula is " << n << endl; 
			if(n > c) cout << "No"; 
			else cout << "Yes"; 
		} 
		cout << endl; 
		 


	}
	return 0; 
	
}