#include<bits/stdc++.h>
using namespace std;
#define fs first
#define sc second
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define All(A) A.begin(),A.end()
#define RAll(A) A.rbegin(),A.rend()
typedef long long LL;
const LL mod=1e9+7;
const LL LINF=1LL<<62;
const LL INF=1<<30;


int main(){
    int t;
    cin >> t;
    while(t--){
        LL a,b,c,d;
        cin >> a >> b >> c >> d;
        if(a<b) puts("No");
        else if(d<b) puts("No");
        else if(c>=b) puts("Yes");
        else{
            if(c<b-__gcd(b,d)+a%b) puts("No");
            else puts("Yes");
        }
    }
    return 0;
}