#include <iostream>
#include <algorithm>
using namespace std;
 
int main() {
    unsigned long long t,a,b,c,d;
    cin >> t;
    for(int i=0;i<t;i++){
        cin >> a >> b >> c >> d;
        if(b>d || a<b){
            cout << "No" << endl;
        } else if(b<=c){
            cout << "Yes" << endl;
        }else{
            bool f=1;
            unsigned long long x = __gcd(b,d);
                if(b-x+a%x>=c){
                    cout << "No" << endl;
                }else{
                cout << "Yes" << endl;
            }
        }
    }
}