#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define VV vector
#define pb push_back
#define bitc  __builtin_popcountl
#define m_p make_pair
long long gcd(long long a,long long b)
{
    if(a%b==0)
        return b;
    else
        return gcd(b,a%b);
}
int main()
{
ios_base::sync_with_stdio(false);
int t;
cin>>t;
while(t)
{
    --t;
    ll a,b,c,d;
    cin>>a>>b>>c>>d;
    if(a<b||d<b)
    {
        cout<<"No";
    }
    else
    {
        if(c>=b-1)
        {
            cout<<"Yes";
        }
        else
        {
            a=a%b;
            if(a>c)
            {
                cout<<"No";
            }
            else
            if(gcd(d,b)==b)
            {
                cout<<"Yes";
            }
            else
            {
                ll r=(d-b)%b;
                a=a%b;
                ll x1=(c-a)/r,x2=(b-1-a)/r;
                ]
                if(x1==x2) 
                    cout<<"Yes";
                else
                    cout<<"No";
            }
        }
    }
    cout<<"\n";
}
}