#include <bits/stdc++.h>
long long A, B, C, D;
long long gcd(long long x, long long y) { return !y ? x : gcd(y, x % y); }
int main() {
  scanf("%*d");
  while (scanf("%lld%lld%lld%lld", &A, &B, &C, &D) == 4) {
    if (A < B || B > D) {
      puts("No");
      continue;
    }
    if (C >= B) {
      puts("Yes");
      continue;
    }
    long long d = gcd(B, D);
    A %= d;
    long long x = C + A;
    if (x <= C) x += d;
    puts(x < B ? "No" : "Yes");
  }
  return 0;
}
