//#pragma GCC optimize("O3")
#include <bits/stdc++.h>
#define ld long double
#define int long long
#define dbgvi(x) cout << #x << " = "; for(int i = 0; i < (x.size()); ++i) cout << x[i] << " ";
using namespace std;

void no(){
    cout << "No\n";
}

void yes(){
    cout << "Yes\n";
}

int gcd(int a, int b){
    if(a == 0)return b;
    return gcd(b % a, a);
}



void solve(){
    int a, b, c, d;
    cin >> a >> b >> c >> d;
    if(b > a || b > d){
        no();
        return;
    }
    if(c >= b){
        yes();
        return;
    }
    int l = c + 1;
    int r = b - 1;
    if(l > r){
        yes();
        return;
    }
    l = (l - (a % b) + b) % b;
    r = (r - (a % b) + b) % b;
    if(l > r){
        int l1 = l;
        int r1 = b - 1;
        int l2 = 0;
        int r2 = r;
        int k1 = ((l1 + g - 1) / g) * g;
        int k2 = ((l2 + g - 1) / g) * g;
        if(k1 <= r1 || k2 <= r2){
            yes();
        } else {
            no();
        }
        return;
    }
    int g = gcd(b, d);
    int k = ((l + g - 1) / g) * g;
    if(k <= r){
        no();
        return;
    } else {
        yes();
        return;
    }
}


signed main(){
    int t = 1;
    cout << fixed << setprecision(10);
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    #ifdef DEBUG
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    #endif
    cin >> t;
    //freopen("skyscraper.in", "r", stdin);
    //freopen("skyscraper.out", "w", stdout);
    //cin >> t;
    while(t--){
        solve();
    }
}
