// Why I am so dumb? :c
#include <bits/stdc++.h>

#define pb push_back
#define mp make_pair

#define all(x) (x).begin(), (x).end()

#define fi first
#define se second

using namespace std;

typedef long long ll;

ll arr[100005];

ll a, b, c, d;

ll ceilD(ll a, ll b) {
    return (a + b - 1) / b;
}
                 
void solve() {                   
    scanf("%lld %lld %lld %lld", &a, &b, &c, &d);    
    ll x = a - b;

    if (x > c) {
        ll k = ceilD(x - c, b);
        x -= k * b;
    }

    if (x < 0) {
        printf("No\n");
        return;
    }

    ll step = d - b;

    if (step < 0) {
        printf("No\n");
        return;
    }

    if (step == 0) {
        printf("Yes\n");
        return;
    }

    x %= step;        
    ll g = __gcd(b, step);

    ll l = x - (b - 1);
    ll r = x - (c + 1);

    if (l < 0) {
        ll k = ceilD(-l, g);
        l += k * g;
        r += k * g;
    }

    if (ceilD(l, g) <= r / g) {
        printf("No\n");
        return;
    }                       
    
    printf("Yes\n");
}

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

    while (tt--) {
        solve();
    }

    return 0;
}