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

int main()
{
   ll a,b,c,d,i;
   int t;
   cin>>t;
   while(t--)
   {
       int f=0;
       cin>>a>>b>>c>>d;
       if(a<b||d<b)
       {
           cout<<"No\n";
           continue;
       }
       else
       {
           ll g=__gcd(b,d);
           ll rem=a%g;
           for(i=1;i<=d;i++)
           {
               if(d>=2*1e8)
               break;
               ll rem2=(c%g-b%g+i%g+g)%g;
              // cout<<rem2;
               if(rem2==rem)
               {
                   f=1;
                  // cout<<"#";
                   break;
                }
           }
         //  cout<<f;
           if(f==0)
           {
                cout<<"No\n";
                continue;
           }
           else
           {
               //cout<<c-b+i;
                if(c-b+i>=0)
                { cout<<"Yes\n";}
                else
                { cout<<"No\n";}
           }
       }
   }
   
   return 0;
}