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

using namespace std;

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

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++){
		count = -1;
		f = 1;
		while(f){
			count++;
			cp[count] = a[i];
			a[i] -= b[i];
			if (a[i] < 0){
				cout << "No" << endl;
				break;
			}
			if (a[i] <= c[i]){
				a[i] += d[i];
			}
			if (count > 10000){
				cout << "Yes" << endl;
				break;
			}
		}
	}
	
	return 0;
}
