#include <bits/stdc++.h>
#include <boost/range/irange.hpp>
#include <boost/range/adaptors.hpp>
#include <boost/math/common_factor.hpp>

using namespace std;
using boost::adaptors::reversed;
using boost::irange;
using uint = unsigned int;
using ll = long long int;
using ull = unsigned long long int;

bool sunao(ll a, ll b, ll c, ll d){
    ll morning = a;
    for (auto && i: irange(0LL, 1000LL)){
        if (morning < b){
            return false;
        } else {
            ll evening = morning - b;
            if (evening <= c){
                morning = evening + d;
            } else {
                morning = evening;
            }
        }
    }
    return true;
}

bool sub(ll a, ll b, ll c, ll d){
    if (a < b || b > d)return false;
    else {
        ll m = boost::math::gcd<ll>(b, d);
        ll r = a % m;
        ll _ = c + 1 - r;
        ll __ = _ / m;
        double ___ = floor((double)(c + 1 - r) / (double) m);

        ll k = (c + 1 - r) % m == 0 ? (ll)___ : (ll)___ + 1;
        ll z = r + k * m;
        if (z >= b) {
            return true;
        } else {
            return false;
        }
    }
}


int main() {
    ll T;
    cin >> T;
    for (auto && i: irange(0LL, T)){
//        cout << i << endl;
        ll a, b, c, d;
        cin >> a >> b >> c >> d;
        if (sub(a, b, c, d)){
            cout << "Yes" << endl;
        } else {
            cout << "No" << endl;
        }
    }
    return 0;
}