/// In The Name Of God
/// I wish, that I could leave it all behind me / Go to my own world where no one can find me
#include<bits/stdc++.h>

using namespace std;

#define F first
#define S second
#define mp make_pair
#define pb push_back
#define int long long
#define ll long long
#define pii pair <int , int>
#define ld long double
#define for2(a,b,c) for(int (a) = (b); (a) < (c); (a)++)
#define for3(a,b,c) for(    (a) = (b); (a) < (c); (a)++)
#define setp cout << fixed << setprecision(15)
#define endl "\n"
#define minit(a,b) a = min(a,b)
#define maxit(a,b) a = max(a,b)
#define PII pair<int,int>
#define Vec vector<int>
#define error(x) cerr << #x << " = " << (x) << endl;
#define all(x) (x).begin() , (x).end()

int test[200][200];

int32_t main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    int t; cin >> t;
    while(t--){
        int a,b,c,d; cin >> a >> b >> c >> d;
        if(d < b || a < b){
            cout << "No" << endl;
            continue;
        }
        if(c+1 >= b){
            cout << "Yes" << endl;
            continue;
        }
        if(__gcd(b,d) == 1){
            cout << "No" << endl;
            continue;
        }
        d %= b;
        a %= b;
        if(a < b && a > c){
            cout << "No" << endl;
            continue;
        }
        if(!d){
            cout << "Yes" << endl;
            continue;
        }
        a += d*((b-1-a)/d);
        if(a > c){
            cout << "No" << endl;
        }else cout << "Yes" << endl;
        continue;

    }
    return 0;
}
