#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <map>
#include <vector>
#include <queue>
#include <algorithm>

using namespace std;

//typedef pair<int,int> P;



int main(){
	int t;
	scanf("%d", &t);

	for(int i=0;i<t;i++){
		long long A,B,C,D;
		scanf("%lld %lld %lld %lld", &A, &B, &C, &D);
		long long g = __gcd(D,B);
		if(B>A){
			printf("No\n");
		}else if(B>D){
			printf("No\n");
		}else if(C>=B){
			printf("Yes\n");
		}else{
			if(B-g+(A%g)>C){
				printf("Yes\n");
			}else{
				printf("No\n");
			}
		}
	}
	return 0;
}
