int mondaiB(){
    // C < i < B になればアウト
    int T;
    cin >> T;
    ll A, B, C, D;
    REP(i, T){
        cin >> A >> B >> C >> D;
        if(A % B > C)printf("No\n");
        else if(B % D == 0){
            if(A % B <= C) printf("Yes\n");
            else printf("No\n");
        }else if(B > D) printf("No\n");
        else{
            if(D - B < B - C)printf("No\n");
            else if(D - B > B - C)printf("Yes\n");
            else{
                if(A % (D - B) == 0)printf("Yes\n");
                else printf("No\n");
            }
        }
    }
    
    return 0;
}
int main(){
    mondaiB();
}