#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef vector<ll> vint;
typedef vector< vector<ll> > vvint;

#define rep(i,n) for(ll i=0;i<n;i++)
#define repf(i,f,n) for(ll i=f;i<n;i++)
#define repr(i,n) for(ll i=n-1;i>=0;i--)
#define mp make_pair
#define mt make_tuple
#define ALL(obj) (obj).begin(), (obj).end()
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

int dy[]={0, 0, 1, -1, 1, -1, -1, 1};
int dx[]={1, -1, 0, 0, 1, 1, -1, -1};


int main() {
    cout<<fixed<<setprecision(10);

    ll t; cin>>t;
    while(t>0){
        t--;
        ll a,b,c,d; cin>>a>>b>>c>>d;

        if(d < b){
            puts("No");
            continue;
        }
        if(a < b){
            puts("No");
            continue;
        }

        if(c >= b) puts("Yes");
        else{
            ll e = a%b;
            ll g = gcd(b,d);
            ll n3 = (c-e)/g + 1;
            if(c < e || n3*g < b-e) puts("No");
            else puts("Yes");
        }
    }

    return 0;

}