#include <iostream>
#include <math.h>
#include <cstdio>

using namespace std;

int t, count, f = 0;
long long a[300], b[300], c[300], d[300], cp[300];

int main(){
	cin >> t;
	for (int i = 0; i < t; i++){
		cin >> a[i] >> b[i] >> c[i] >> d[i];
	}
	for (int i = 0; i < t; i++){
		while(1){
			cp[count] = a[i];
			f = 0;
			while(a[i] > c[i]){
				if(a[i] < b[i]){
					cout << "No" << endl;
					f = 1;
					break;
				}else{
					a[i] -= b[i];
					count++;
				}
				for (int j = 0; j < count; j++){
					if (a[i] == cp[count]){
						cout << "Yes" << endl;
						f = 1;
						break;
					}
				}
			}
			if (f) break;
			a[i] += d[i];
		}
	}
	
	return 0;
}
