#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
LL t,a,b,c,d;
int main(){
	LL i,j,k;
	cin>>t;
	while(t--){
		cin>>a>>b>>c>>d;
		if(a<b){
			cout<<"No\n";
			continue;
		}
		k=__gcd(d,b);
		if(k==1&&c<b-1){
			cout<<"No\n";
			continue;
		}
		i=a%b;
		j=(c+d-i)/k;
		j=(j*k+a)%b;
		for(i=0;i<5;i++){
			if((j>c&&j<b)||(j+d<b)){
				cout<<"No\n";
				break;
			}
			j+=k;
			j%=b;
		}
		if(i==5)cout<<"Yes\n";
	}
	return 0;
} 