#include<iostream>
#include<string.h>
#include<map>
#include<set>
#include<vector>
#include<stdio.h>
#include<math.h>
#include<string>
#include<algorithm>
#include<queue>
#define f first
#define s second
using namespace std;
/* 
                            +777777777?
                           7$.I77777III777:
                           7:I?I777777777
                           777777777777,
                           $
                           $
               7$$$$$$7....$..,I$$$$$$$$I7
             7$$$$$$$$$$$$$$$$$$$$$$$$$$$$I
           I$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$I
          7$$$$$$$$$$$$$$$$$$$$$$$7$7$$$$$$$I
          I$$$$$$$$$$$$$$$$$$$$$$$$$7$$$$$$$$I
         I$$$OOOOOOOOZ$$$$$$$$$$$$OOOOOOOOZ$$I
         I$$$OOO$$$$$$$ZOOOOOOOOZ$$$$7$ZOO8$$I
         I$$$$O$$$O  O$$$OOZOO$$$$O  O$$$OO$$$I    $
          $$$$O$$$8OOO$$$O$$$O$$$ZOO$7$$O$$$$I   $$$$
          I$$$$Z$$$ZZ$$$$O$$$$O$$$ZZ$$$$O$$$$    $$$$7
          7$$$$ZO$$$$$$OO$$$$$$O$$$$$$$O$7$$I  I$
           I$$$$$ZZOOZZ$$$$$$$$$$ZOOZZZ7$$$$.I7
          I$$$$$$$$$$--$$OO:7O$$$$$--$$$$$$7$
        $$..:$$$$$$$$\$$$$$Z$$$$$$$/$$$$$$$
        $$ ...$$$$$$$$-------------$$$$$$I
         $+Z$$$7$$$$$$$$$$$$$$$$$$$$$$$$+
            $$$$,I$$$$$$$$$$$$$$$$$$$$$I
                  I$$$$$$$$$$$$$$$$$$~
                    I$$$$$$$$$$$$$$:
                       $        $
                       $        $
                      =,        :
                    ++77        77++
*/
int main(){
  int n;
  cin>>n;
  while(n--){
    unsigned long long a,b,c,d,now;
    cin>>a>>b>>c>>d;
    if(d<b || a<b || a%b>c){
      cout<<"No"<<endl;
    }
    else{
      int x=__gcd(b,d);
      now=(a-b)-(a-b)%x+x;
      if(a-now<=c)
        cout<<"Yes"<<endl;
      else
        cout<<"No"<<endl;
    }
  }
  return 0;
}