#include <bits/stdc++.h>
#include <iostream>
#include <iomanip>
#include <cmath>
#include <vector>
#include <queue>
#include <limits>
#include <algorithm>
#include <string>
using namespace std;
 
#define rep(i, N) for (int i = 0; i < N; i++)
#define pb push_back
 
typedef long long ll;
typedef pair<ll, int> ll_i;

int main() {
    ll T;
    cin >> T;
    for (int i = 0; i < T; ++i){
        ll A,B,C,D;
        cin >> A >> B >> C >> D;
        if (A - B < 0){
            cout << "No" << endl;
            continue;
        }
        if (B - D < 0){
            cout << "No" << endl;
            continue;
        }
        if (B <= C){
            cout << "Yes" << endl;
            continue;
        }
        ll g = gcd(B,D);
        if (B - g + (A % g) > C){
            cout << "Yes" << endl;
        } else {
            cout << "No" << endl;
        }
    }
    return 0;
}