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

#define int long long 

void read(int &x) {
    x=0;int f=1;char ch=getchar();
    for(;!isdigit(ch);ch=getchar()) if(ch=='-') f=-f;
    for(;isdigit(ch);ch=getchar()) x=x*10+ch-'0';x*=f;
}

void print(int x) {
    if(x<0) putchar('-'),x=-x;
    if(!x) return ;print(x/10),putchar(x%10+48);
}
void write(int x) {if(!x) putchar('0');else print(x);putchar('\n');}

#define lf double
#define ll long long 

#define pii pair<int,int >
#define vec vector<int >

#define pb push_back
#define mp make_pair
#define fr first
#define sc second

#define data asd09123jdf02i3h

#define FOR(i,l,r) for(int i=l,i##_r=r;i<=i##_r;i++)

const int maxn = 1e6+10;
const int inf = 1e9;
const lf eps = 1e-8;
const int mod = 1e9+7;

#define yes return puts("Yes"),void()
#define no return puts("No"),void()

void solve() {
    int a,b,c,d;read(a),read(b),read(c),read(d);
    if(d<b) no;
    if(a<b) no;
    if(c>=b) yes;
    a%=b;if(a>c) no;
    if(d%b==0) yes;
    int t=__gcd(c,d%b);
    int mn=a%t,mx=a+t*((b-1-a)/t);
    // printf("%lld %lld\n",mn,mx);
    if(mn+d<b) no;
    if(mx>c) no;
    yes;
}

signed main() {
    int t;read(t);while(t--) solve();
    return 0;
}
