#include<bits/stdc++.h>
#define ll long long
using namespace std;
main(){
    int n;
    cin >> n;
    for(int i = 0; i < n; i++){
        long long a,b,c,d;
        cin >> a >> b >> c >> d;
        if(d < b || a < b) {
            cout<<"no"<<endl;
            continue;
        }
        if(c >= b-1){
            cout<<"yes"<<endl;
            continue;
        }
        if(a % __gcd(b,d) + b - __gcd(b,d) <= c){
            cout << "yes"<<endl;
            continue;
        }
        cout << "no"<<endl;
        continue;
    }

}
