#include<bits/stdc++.h>
using namespace std;
#define rep(i,j,n) for(int i=(int)(j);i<(int)(n);i++)
#define REP(i,j,n) for(int i=(int)(j);i<=(int)(n);i++)
#define MOD 1000000007
#define int long long
#define ALL(a) (a).begin(),(a).end()
#define vi vector<int>
#define vii vector<vi>
#define pii pair<int,int>
#define priq priority_queue<int>
#define disup(A,key) distance(A.begin(),upper_bound(ALL(A),(int)(key)))
#define dislow(A,key) distance(A.begin(),lower_bound(ALL(A),(int)(key)))
#define tii tuple<int,int,int>
#define Priq priority_queue<int,vi,greater<int>>
#define pb push_back
#define mp make_pair
#define INF (1ll<<60)
signed main(){
  int T; cin>>T;
  rep(i,0,T){
    int A,B,C,D; cin>>A>>B>>C>>D;
    string ans="No";
    int X=__gcd(A,B);
    X=__gcd(X,D);
    if(C>=B-X) ans="Yes";
    if(((A%B!=0&&A%B<=C)||B<=C)&&D%B==0) ans="Yes";
    cout<<ans<<endl;
  }
  }
