/*
#pragma GCC optimize("O2")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("avx,avx2,sse,sse2,fma,tune=native")
//*/
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int  ,int > pii;

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

const ll maxn  = 3e6;
const ll mod =1e9+7;
const ld PI = acos((ld)-1);

#define pb push_back
#define endl '\n'
#define dokme(x) return(cout << x << endl , 0);
#define migmig ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define ms(x , y) memset(x , y , sizeof x);
#define file_init freopen("input.txt", "r+", stdin); freopen("output.txt", "w+", stdout);
ll pw(ll a, ll b, ll md = mod){ll res = 1;while(b){if(b&1){res=(a*res)%md;}a=(a*a)%md;b>>=1;}return(res);}

ll a , b , c , d;
int q;

int solve(){
    if(b > min(a,d))
        dokme("No")
    ll gc = __gcd(b , d);
    a%=gc;
    if(c - b + 1 >= 0)
        dokme("Yes");
    ll val = c - b + 1;
    ll bz = (val + 100LL*gc)%gc;
    bz = (a - bz + gc*100LL)%gc;
    if(c - b + 1 + bz >= 0)
        dokme("Yes");
    dokme("No");
}

int32_t main(){
    migmig
    cin >> q;
    while(q -- ){
        cin >> a >> b >> c >> d;
        solve();
    }
    return(0);
}