#include<bits/stdc++.h>
using namespace std;

long long int T, A, B, C, D, E, F;

int main(){
    scanf("%lld", &T);
    for(int i = 0; i < T; ++i){
        scanf("%lld%lld%lld%lld", &A, &B, &C, &D);
        if(A < B){
            puts("No");
            continue;
        }
        if(B > D){
            puts("No");
            continue;
        }
        A %= B;
        if(A > C){
            puts("No");
            continue;
        }
        if(D % B == 0){
            puts("Yes");
            continue;
        }
        E = __gcd(__gcd(B, D), C);
        F = (C - A + E) / E;
        if(A + F * E > C && A + F * E < B){
            puts("No");
            continue;
        }
        puts("Yes");
    }
    return 0;
}