#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<cctype>
#include<math.h>
#include<string>
#include<string.h>
#include<stack>
#include<queue>
#include<vector>
#include<utility>
#include<set>
#include<map>
#include<stdlib.h>
#include<iomanip>

using namespace std;

#define ll long long
#define ld long double
#define EPS 0.0000000001
#define INF 1e9
#define MOD 1000000007
#define rep(i,n) for(i=0;i<(n);i++)
#define loop(i,a,n) for(i=a;i<(n);i++)
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
#define int ll
typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<int,int> pii;
/*
int gcd(int n,int m){
    if(m==0)return n;
    return gcd(m,n%m);
}
*/
signed main(void) {
    int i,j;
    int n;
    cin >> n;
    rep(i,n){
        ll a, b, c, d;
        cin >> a >> b >> c >> d;
        bool ans = true;
        if(a<b) ans = false;
        else if(b>d) ans = false;
        else if(b-1<=c) ans = true;
        else{
            int l = ((c+1-a)%b+b)%b;
            int r = ((b-1-a)%b+b)%b;
            int g = gcd(b,d);
            if(l<=r && (l/g != r/g || l%g==0)) ans = false;
            if(l>r) ans = false;
        }
        if(ans) cout << "Yes" << endl;
        else cout << "No" << endl;
    }
}
