#include<bits/stdc++.h>


using namespace std;

int T;
long long int A,B,C,D;

int main() {
	int i,j,k,l,r,x,y; string s;

	cin>>T;
	while(T--) {
		cin>>A>>B>>C>>D;

		if(D<B || A<B) {
			cout<<"No"<<endl;
			continue;
		}
		if(C>=B-1) {
			cout<<"Yes"<<endl;
			continue;
		}

		D=__gcd(D,B);
		long long int L=((C+1)-A)%B;
		long long int R=((B-1)-A)%B;
		if(R>=L) {
			if(L/D == R/D && L%D) {
				cout<<"Yes"<<endl;
			}
			else {
				cout<<"No"<<endl;
			}
		}
		else {
			cout<<"No"<<endl;
		}


	}
}
