/*betaでやろう*/
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <cmath>
#include <set>
#include <map>
#include <string>
#include <numeric>
#include <cstdio>
#include <cstdlib>
#include <iterator>
#include <cstring>

using namespace std;

typedef pair<int, int> P;
typedef long long ll;
#define PB push_back
#define rep(i, a) for(int i = 0; i < a; i++)
#define all(v) v.begin(),v.end()
#define FF first
#define SS second
#define mp make_pair
#define INT int_64
const ll INF = 1e17;
const ll NEGA=-INF; 

ll ans = 0;
int cnt=0;

int used[1001];
ll dp[1001][1001];
ll sumx,sumy,sumz;
ll sx,sy,sz;
int J[300];
int main() 
{ 
 int t;
 cin>>t;
 ll a,b,c,d;
 int f=0;
 rep(i,t){
     f=0;
     cin>>a>>b>>c>>d;
     ll res=a%b;
     if(a<b) f=1;
     rep(i,min(7000000,a)){
     if(res>c){
         f=1;
         continue;
     }
     res+=d;
     if(res<b){ 
         f=1;
         continue;
     }
     res%=b;
     }
    if(f) J[i]=1;
 }
 rep(i,t){
     if(J[i]) cout<<"No"<<endl;
     else cout<<"Yes"<<endl;
 }
}

