#include <bits/stdc++.h>
using namespace std;
long long gcd(long long x, long long y) { return y ? gcd(y, x % y) : x; }
int main() {
  int T;
  scanf("%d", &T);
  while (T--) {
    long long a, b, c, d;
    scanf("%lld%lld%lld%lld", &a, &b, &c, &d);
    if (a < b || b > d) {
      puts("No");
      continue;
    }
    long long G = gcd(b, d);
    a %= G;
    long long mn = c - b;
    mn = mn / G * G + a;
    for (; mn <= c; mn += G)
      ;
    if (mn < b)
      puts("No");
    else
      puts("Yes");
  }
}
