int main(){
    int t;
    long long a,b,c,d;
    long long tmp;
    cin >> t;
    for(int i=0; i<t;i++){
        cin >> a >> b >> c >> d;
        if(a >= b && d >= b){
            bool k[b];
            for(long long j=0;j<b;j++){
                k[j]=false;
            }
            tmp = a%b;
            k[tmp] = true;
            while(true){
                tmp = (tmp +(d-b))%b;
                if(tmp > c && b > tmp){
                    cout << "No" << endl;
                    break;
                } else if(k[tmp]){
                    cout << "Yes" << endl;
                    break;
                }
                k[tmp] = true;
            }
        }else{
            cout << "No" << endl;
        }
    }
    return 0;
}